I am trying to get a simple curses script to run using Python (with PyCharm 2.0).
This is my script:
import curses
stdscr = curses.initscr()
curses.n
If you are using macOS and running PyCharm you will have to set environment variables from the IDE itself, for execution scope.
Edit Configurations -> Environment variables
then add the below name-value pairs
TERM linux
TERMINFO /etc/zsh
The above is equivalent to exporting environment variable from the console which is done like this
$ export TERM=linux
$ export TERMINFO=/bin/zsh
the default for TERM is xterm, other values are [konsole, rxvt] rxvt for example is often built with support for 16 colors. You can try to set TERM to rxvt-16color.
/bin/zsh is path of the terminal application that I use in mac.
It's like telling your program that you will be logging into linux(TERM) like terminal which can be found at /bin/zsh. For using bash shell it could be something like /bin/bash .