Answers for "python take system arguments"

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 "python take system arguments"

Python Answers by Framework

Browse Popular Code Answers by Language