python call python script with arguments code example
Example 1: python arguments
import sys
print ("the script has the name %s" % (sys.argv[0])
Example 2: program arguments python
#!/usr/bin/python
import sys
for args in sys.argv:
print(args)
"""
If you were to call the program with subsequent arguments, the output
will be of the following
Call:
python3 sys.py homie no
Output:
sys.py
homie
no
"""