Need to use the command line execution method parameter passing py file

Reference:  https://www.cnblogs.com/answerThe/p/11315185.html

#coding=utf-8
import sys
gpus = sys.argv[1]
gpus2 = sys.argv[2]
print(gpus)
print(gpus2)

 

In the terminal command execution

python / Users / lucax / Desktop / test laboratory /b.py Do not you

 

Export 

you

Mo

Guess you like

Origin www.cnblogs.com/kaibindirver/p/12189170.html