Answers for "system parameter python"

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

Python Answers by Framework

Browse Popular Code Answers by Language