# File: args.phy # Purpose : show how to process command line arguments import sys print sys.argv # just display the array of arguments # Sample run: # Command line: python args.phy -one -two threee # Output: ['args.phy', '-one', '-two', 'threee'] # The first argument is the name of the python program being run, # the rest are just a list of the arguments passed. # Print out the arguements that follow the program name: print sys.argv[1:] # see also slices # print out only the program name print sys.argv[0] #print out the number of comand line argumens print len(sys.argv)