First page Back Continue Last page Overview Graphics

Command Line Parameters

The sys modul contains a list with the command line parameters: sys.argv

The command line arguments can be printed liks this:

import sys

print(sys.argv)

If those two lines are saved in par_test.py, we can see the following:

$ par_test.py Apples Cherries Bananas

['./par_test.py', 'Apples', 'Cherries', 'Bananas']