问题描述
我正在尝试在 Win7 的 Eclipse 中使用 PyDev 中的 Curses.
I am trying to use Curses in PyDev in Eclipse in Win7.
我已经安装了 Python 3.2(64 位)和 curses-2.2.win-amd64-py3.2.当我将以下测试代码输入 PyDev 时:
I have installed Python 3.2 (64bit) and curses-2.2.win-amd64-py3.2. When I input the following testing codes into PyDev:
import curses
myscreen = curses.initscr()
myscreen.border(0)
myscreen.addstr(12, 25, "Python curses in action!")
myscreen.refresh()
myscreen.getch()
curses.endwin()
它没有显示任何语法错误,所以我认为curses安装正确.
It did not show any syntax error, so I think the curses was installed correctly.
但是,当我将其作为 Python Run 运行时,输出显示:不支持重定向.我不知道这个问题从何而来.我用谷歌搜索了很多,但找不到相关信息.
However, when I ran it as Python Run, the output showed: Redirection is not supported. I do not know where this problem comes from. I googled a lot but can't find related information.
推荐答案
最近的 PyCharm 版本(我目前运行的是 2017.2,不确定何时添加此选项,或者是否一直存在)有选项模拟输出控制台中的终端".选中此选项后 Curses 有效.
Recent PyCharm versions (I am currently running 2017.2, not sure when this option was added, or if it has been there the entire time) have the option "Emulate terminal in output console". Curses works with this option checked.
这篇关于不支持 Python 诅咒重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!