Python 2.7 看看下面。我不懂这个节目
如何获得如下输出Python 2.7 看看下面。我不懂这个节目,python-2.7,Python 2.7,如何获得如下输出 from sys import argv script, first, second, third = argv print "The script is called:", script print "Your first variable is:", first print "Your second variable is:", second print "Your third variable is:", third 我从获得了程序。您需要将脚本命名为script.
from sys import argv
script, first, second, third = argv
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
我从获得了程序。您需要将脚本命名为script.py,然后从命令行运行它,如下所示:
The script is called: script.py
Your first variable is: first
Your second variable is: 2nd
Your third variable is: 3rd
解释就在你链接的页面的一半
python script.py first 2nd 3rd