+ 1
Puthon to take command line arguments on running a script.
2 Answers
+ 6
Use module 'sys' and its 'argv' list:
import sys
print(len(sys.argv)) # number of command line 'arguments' (including the running script file name at index zero)
However, you can use the 'getopt' module to more easily handle them:
https://www.tutorialspoint.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_command_line_arguments.htm
+ 1
thanks dear