Python program to print the runtime arguments
kw.py
import sys 
print("File Name",sys.argv[0])
print("Number of Arguments",len(sys.argv))
print("Arguments",str(sys.argv))
Output
kodingwindow@kw:~$ python3 kw.py C1 C2
File Name kw.py
Number of Arguments 3
Arguments ['kw.py', 'C1', 'C2']
Advertisement