CommandlineTools

Legacy Wiki Page

This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.

Creating Command Line Tools With Python

Standard library support for parsing command lines

  • optparse and argparse (optparse is marked as deprecated since the introduction of argparse with Python 2.7 and Python 3.2, use argparse unless you have to support older Python versions)

  • getopt C-style command line parser

The Argparse Tutorial is an excellent read for getting you started with creating command line tools. See also OptionParsing.