Parse command-line arguments with argparse in Python

Posted by bob on Aug 16, 2021 5:57 PM EDT
Opensource.com
Mail this story
Print this story

There are several third-party libraries for command-line argument parsing, but the standard library module argparse is no slouch either. Without adding any more dependencies, you can write a nifty command-line tool with useful argument parsing. Argument parsing in Python When parsing command-line arguments with argparse, the first step is to configure an ArgumentParser object. This is often done at the global module scope since merely configuring the parser has no side effects. read more

Full Story

  Nav
» Read more about: Groups: Python; Story Type: News Story

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.