Differences between revisions 16 and 17
Revision 16 as of 2021-02-07 21:56:55
Size: 2140
Editor: IwanAucamp
Comment:
Revision 17 as of 2021-02-07 21:57:21
Size: 2141
Editor: IwanAucamp
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
The [[https://docs.python.org/howto/argparse.html|Argparse Tutorial]] is an excellent read for getting you started with creating command line tools. See also ConfigParser. The [[https://docs.python.org/howto/argparse.html|Argparse Tutorial]] is an excellent read for getting you started with creating command line tools. See also OptionParsing.

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.


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

CommandlineTools (last edited 2021-02-07 21:57:21 by IwanAucamp)

Unable to edit the page? See the FrontPage for instructions.