Answers for "system arguments in py"

1

python system arguments

import sys

print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)

########### command: python test.py arg1 arg2 arg3 ############
Number of arguments: 4 arguments.
Argument List: ['test.py', 'arg1', 'arg2', 'arg3']
Posted by: Guest on July-13-2021

Code answers related to "system arguments in py"

Python Answers by Framework

Browse Popular Code Answers by Language