tags: Python Development language sys sys.argv
sys.argv [] is used to get the parameters of transmission
sys.argv [0] is the py file itself
For example
import sys
a=sys.argv[0]
b=sys.argv[1]
print(a)
print(b)
print(sys.argv[2])
Results of the:

Use sys.argv case learning in Python3 ...
Foreword Normally when we use the python package written by others, we can view the help information by typing xx -h in cmd, and enter the parameters into the program by typing xx -p 8080. In this art...
Table of contents 1、sys.argv 2、argparse 3. It is better to combine two uses Look at the code in detail, so I won't get water here. 1、sys.argv 2、argparse Case 1: Case 2: 3. It is better to combine two ...
Reference link) sys.argv[] is used to pass parameters to the script when executing the script. python XX.py kkkk #Is to XX.py The parameters of kkkk are passed in. It can also be multiple, as shown in...
Friends who have had other programming fundamentals should know that this is used to accept command line arguments. You need to enter the parameters in the windows command line or mac terminal to test...
The first time I contacted this was when I read someone else’s code and someone wrote one. if len(sys.argv) == 3: Then I don’t understand what it means Next, let me talk about the usage of...
Sys.argv[] is a bridge that takes parameters from outside the program. This "external" is critical. Because we can get more than one parameter from the outside, we get a list, which means th...
Sys.argv : used to store the parameters you enter in the cmd environment, using the list format (the first element of the list is the .py file you want to execute, followed by the parameters) An examp...
I. Introduction SYS is a built-in module that comes with Python. "Sys.Argv [0]" meanings: indicates the file path where the code itself is located. Sys.Argv is white to get the bridge from t...
1. When I originally wanted to execute the script, I passed in the parameters, and the sys module can be used to read the passed in parameters. I first used sys.argv[0] Module file: install_app_v1.0_c...