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

查看:95
本文介绍了为什么命令重定向操作符在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?

推荐答案

在运行->编辑配置中可用.

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天全站免登陆