Cobol Card Punch Programming Code

If you're using Python for any amount of development, you have probably issued a command in a terminal, even if only to launch a Python script or install a Python module with pip.

The POSIX shell automatically splits whatever you type as a command into an array.

You could write a loop to iterate over each item; determine whether it is the command, an option, or an argument; and take action accordingly. Luckily, a module called argparse already exists for that.

The link for this article located at Opensource.com is no longer available.