≡ Menu

Python argparse

Debian Linux Squeeze 6.0: Install Python v2.6/2.5 Argparse Module

I would like to use argparse module for Python 2.6 under Debian Linux. However, the code is not working. How do I install and use argparse Python module under Debian Linux 6.x for Python version 2.5 or 2.6?
[click to continue…]

Python Command Line Arguments Examples

I am a new Python programming user. I am working on user-friendly command-line interfaces, and I want to pass input via the shell args as follows:

./myscript.py filename
./myscript.py in.file output.file
./myscript.py -i in.file -o output.file

How do I pass and parse command-line options and arguments using Python under Linux or Unix-like operating systems?
[click to continue…]