简体   繁体   English

使用PyScripter执行带有参数的python文件

[英]Execute a python file with arguments with PyScripter

I have a piece of python code. 我有一段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

I use PyScripter IDE for Python 2.7, but not sure how to pass the arguments with it, there is a Python Interpreter window on the bottom of the IDE. 我将PyScripter IDE用于Python 2.7,但不确定如何使用它传递参数,IDE底部有一个Python解释器窗口。

IDE

Found the solution by myself. 自己找到解决方案。 Click Run Menu will find the command line parameters. 单击“运行菜单”将找到命令行参数。 Then clicking it to input what you want. 然后单击它以输入所需的内容。

图片

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM