Testing curses in Python from VS Community 2019 bult-in terminal

Viewed 167

Using Visual Studio Community 2019 v16.5.5, I successfully installed curses into my Python environment using pip install. When I create the following script and run it from a command (Powershell in Win10) terminal, it works as advertised.

import curses

print("Preparing to initialize screen.")
screen = curses.initscr()
print("Screen initialized")
screen.refresh()

curses.napms(2000)
curses.endwin()

print("Window ended")

However, when running it within the VS environment, I get errors:

Preparing to initialize screen.
LINES value must be >= 2 and <= 0: got 1
initscr(): Unable to create SP
Press any key to continue . . .

While I'm perfectly happy to keep a separate window open for running code, this is going to get difficult if I need to debug. If you're using "Community" (as opposed to VS "Code"), is there a way to change the console VS is using for Python debugging?

NOTE: All of the answers related to the Python console that I've found so far are related to VS Code, which is a different beast as opposed to VS Community.

UPDATE: Setting the option "Use legacy debugger" seems to work for now, at least for this code.

0 Answers
Related