Any Python/Curses resources?
windows - What is needed for curses in Python 3.4 on Windows7? - Stack Overflow
user interface - Are there any toolkit libraries for curses with Python bindings? - Stack Overflow
Does python have a curses lib that looks THIS good?
Videos
I know curses is generally disliked around here, and tcod is recommended. I've tried to get tcod working on two operating systems though, and couldn't get it to work on either. I haven't tried really hard though, because curses really appeals to me, both by being the traditional library used for most of the roguelikes I played growing up, and also because of the small footprint when it comes to system resources.
There aren't many Python/Curses resources out there. I've found a few non-roguelike-specific tutorials on youtube, the Rogue Detective source, and this non-functional algorithm. I'm pretty sure this is enough for me to cobble together something playable. I'm just curious whether there are better methods I could be using.
» pip install windows-curses
You can use curses cross-platform (Windows, MacOS, GNU/Linux) if you install manually for Windows or like other package in others.
Install wheel package. If you need more info about wheel click here.
Go to this repository.
Download a package with your python version, in example for python 3.4:
curses-2.2-cp34-none-win_amd64.whlInstall it (this command if for windows, in GNU/Linux install like other package)
python -m pip install curses-2.2-cp34-none-win32.whlJust include in your python script:
import curses
You can use curses wrapper for python. Works in Fedora 25 in all terminals, and Windows 10 using git bash, powershell, or cmd.
Update:
- An alternative to curses in Windows here.
- Console user interface in Windows here.
- An interesting tutorial here.
Now we can easy install on python 3.7 using pip install windows-curses
Urwid is the best library to work with curses and python that I know.
Altenatively, you might find also interesting snack (newt-based library).
For more information, please have a look at this question.
npyscreen
Npyscreen is a Python widget library and application framework for programming terminal or console applications. It is built on top of ncurses, which is part of the standard library.
The focus of this library is to provide a rapid way to develop console applications. In general, adding a control to the screen requires only one line of code.
This framework should be powerful enough to create everything from quick, simple programs to complex, multi-screen applications.

#!/usr/bin/env python
# encoding: utf-8
import npyscreen
class TestApp(npyscreen.NPSApp):
def main(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
F = npyscreen.Form(name = "Welcome to Npyscreen",)
t = F.add(npyscreen.TitleText, name = "Text:",)
fn = F.add(npyscreen.TitleFilename, name = "Filename:")
fn2 = F.add(npyscreen.TitleFilenameCombo, name="Filename2:")
dt = F.add(npyscreen.TitleDateCombo, name = "Date:")
s = F.add(npyscreen.TitleSlider, out_of=12, name = "Slider")
ml = F.add(npyscreen.MultiLineEdit,
value = """try typing here!\nMutiline text, press ^R to reformat.\n""",
max_height=5, rely=9)
ms = F.add(npyscreen.TitleSelectOne, max_height=4, value = [1,], name="Pick One",
values = ["Option1","Option2","Option3"], scroll_exit=True)
ms2= F.add(npyscreen.TitleMultiSelect, max_height =-2, value = [1,], name="Pick Several",
values = ["Option1","Option2","Option3"], scroll_exit=True)
# This lets the user interact with the Form.
F.edit()
print(ms.get_selected_objects())
if __name__ == "__main__":
App = TestApp()
App.run()