output.txt" 我在 Eclipse 中通过 pyd-6ren">
gpt4 book ai didi

python - 如何在 Eclipse 中通过运行配置传递程序参数

转载 作者:行者123 更新时间:2023-12-01 05:45:01 24 4
gpt4 key购买 nike

我正在运行一个Python程序,我想将输出通过管道传输到文件。所以在 python 中这个命令是

 "python myfile.py > output.txt" 

我在 Eclipse 中通过 pydev 运行程序,如何将参数“> output.txt”传递到 Eclipse 中的运行配置?好像没有这个选项:

enter image description here

当我按照上面的方法尝试时,我收到错误:

C:\Python27\python.exe: can't open file 'output.txt': [Errno 2] No such file or directory

最佳答案

转到项目的运行配置 -> 打开“公共(public)”选项卡 -> 找到“标准输入和输出”选项卡。选中"file"并选择您想要输出的文件。

enter image description here

关于python - 如何在 Eclipse 中通过运行配置传递程序参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16373469/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com