我是 Python 和 Eclipse 的新手,在理解如何将命令行参数传递给在 Eclipse(Pydev) 中运行的脚本时遇到了一些困难。
The following link解释如何将命令行参数传递给 python 脚本。
将命令行参数传递给模块argecho.py
(来自上面链接的代码),
#argecho.py
import sys
for arg in sys.argv: 1
print arg
我需要输入 python 控制台
[you@localhost py]$ python argecho.py
argecho.py
或
[you@localhost py]$ python argecho.py abc def
argecho.py
abc
def
如何在 Eclipse(Pydev) 中将相同的参数传递给 Python 脚本???
谢谢!
最佳答案
关于python - 在 Eclipse(Pydev) 中将命令行参数传递给 Python 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4355721/