Python代码不会暂停

时间:2013-09-29 01:06:33

标签: python

我正在经历Zed Shaw的“艰难学习Python”,我正在练习13,我不能让python暂停,所以我可以看到代码的作用。

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

raw_input(' Press enter')

1 个答案:

答案 0 :(得分:3)

您的脚本没有问题。您需要使用正好3个参数调用脚本。否则会引发错误。

用于运行带参数的应用程序:

  1. 打开命令提示符
  2. 运行命令:python <yourpath>\script.py arg1 arg2 arg3
相关问题