python:Redirection is not supported.

Redirection isnot supported. 不支持重定向

解决方法:

cmd: 
在CMD命令行中,输入 “python” + “空格”,即 ”python “; 
将已经写好的脚本文件拖拽到当前光标位置,然后敲回车运行即可

pycharm:

Run->Edit Configurations,勾选 “Emulate terminal in output console”,应用并确定即可。

用pycharm错误原因:使用的某些语法需要在终端上运行,而在IDE中运行脚本,比如pycharm或者其它的,所有的IDE都需要一个仿终端的控制台,可以用此选项进行检查

reference:

https://blog.csdn.net/war_skywalker/article/details/79436439

猜你喜欢

转载自blog.csdn.net/qq_38150441/article/details/81607783
今日推荐