Answers for "how to call a python script with arguments"

8

python read arguments

#!/usr/bin/python

import sys

print('Number of arguments:', len(sys.argv), 'arguments.')
print('Argument List:', str(sys.argv))
Posted by: Guest on March-01-2020
9

python arguments

import sys

print ("the script has the name %s" % (sys.argv[0])
Posted by: Guest on November-18-2019

Code answers related to "how to call a python script with arguments"

Python Answers by Framework

Browse Popular Code Answers by Language