Python Redirects Redirection not supported

I am trying to use Curses in PyDev in Eclipse in Win7.

I installed Python 3.2 (64 bit) and curses-2.2.win-amd64-py3.2. When I enter the following test codes in PyDev:

import curses myscreen = curses.initscr() myscreen.border(0) myscreen.addstr(12, 25, "Python curses in action!") myscreen.refresh() myscreen.getch() curses.endwin() 

He did not find any syntax error, so I believe that the curses were set correctly.

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 cannot find the relevant information.

+8
python curses pydev
source share
2 answers

You cannot count on using curses with a non-terminal.

You will probably get this because you are running the script from within the IDE, such as PyCharm or whatever.

All IDE servers provide consoles that are not terminals, so where the problem arises.

+8
source share

Recent versions of PyCharm (I am currently using 2017.2, I’m not sure when this option was added or if it was there all the time) there is the option β€œEmulate terminal in output console”. Curses works with this option.

enter image description here

+3
source share

All Articles