#!/usr/bin/python3 # -*- coding: utf-8 -*- # %% Command line arguments """ For example, when running args.py $ python3 args.py option1 option2 sys.argv is the list of command-line arguments. len(sys.argv) is the number of command-line arguments. Note that all command-line arguments in argv are strings. If an argument represents a different type like a number, then the argument needs to be converted using one of the built-in functions such as int() or float(). # python3 script.py myarg1 myarg2 #print(sys.argv[0]) # prints script.py #print(sys.argv[1]) # prints std var1 #print(sys.argv[2]) # prints std var2... """ import sys # List of command line arguments passed to a Python script: print(sys.argv) print(len(sys.argv)) print(sys.argv[0]) for arg in sys.argv: print(arg) # See args.py now.