为什么命令重定向运算符在 PyCharm 中不起作用? [英] Why doesn't command redirection operator work in PyCharm?

查看:35
本文介绍了为什么命令重定向运算符在 PyCharm 中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 PyCharm 中运行一个 python 脚本并将输出的标准输入重定向到一个文件.因此,我打开了运行/调试配置并输入:

I want to run a python script in PyCharm and redirect the stdin out put to a file. Therefore, I opened Run/Debug configurations and typed:

>> output.txt

在脚本参数字段中.当我运行脚本时,我收到错误:

in script parameters field. When I run the script, I get the error:

错误:无法识别的参数:>> output.txt

error: unrecognized arguments: >> output.txt

你知道如何在 PyCharm 环境中使用重定向操作符吗?

Do you know how to use redirection operator in PyCharm environment?

推荐答案

它在 Run -->EditConfigurations 中可用.

It is available in Run -->EditConfigurations.

在右侧,您将看到日志选项卡,其中显示将控制台输出保存到文件.

On the right side you will have Logs tab which says Save console output to file.

您可以使用该选项.

这篇关于为什么命令重定向运算符在 PyCharm 中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆