SoFunction
Updated on 2024-11-13

python receives and handles out-of-band parameter methods

When executing python code, it is sometimes necessary to pass outside parameters to be processed

How should this be realized?

Requires a module

from sys import argv

Of course, it is also possible to just import the sys

import sys

And then when it's time to use it, it's time to use it.

import sys
print "the script name is ", [0]
for num in range(1, len()):
 print "parameter %d is %s "% (num, [num])

The results are as follows:

python  this is a test last_parameter_Success
the script name is 
parameter 1 is this 
parameter 2 is is 
parameter 3 is a 
parameter 4 is test 
parameter 5 is last_parameter_Success 

Above this python receive processing outbound parameter method is all that I have shared with you, I hope to give you a reference, and I hope you will support me more.