[ Web Proxy ]
URL:
Viewing: https://wiki.python.org/moin/../python/platforms/../../python/archive/JAM/../CommandlineTools.html [Back]  [Original]

Commandline Tools - Python Wiki
Python Wiki
psf/wiki 0 0
Copy page

Commandline Tools

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.


Other articles on Python command line tools

For sysadmins familiar with Bash scripting: Beginner Level, circa 02/2008

Using Python To Create Unix Commandline Tools: Beginning/Intermediate Level

Command line tool with optparse, subprocess, and logging: Beginning/Intermediate level

  • Summary: This script provides shortcuts for using a Git repository but the script could be used as a template for other shell tools.

  • A Clean Python Shell Script.

PyCon2008 Presentation on Command Line Tools: Intermediate Level

Back to top

Web Proxy Viewer  |  New URL  |  Original Page