문제

I'm a Python newbie.

I need something like Curses library for Python 2.6 or 3.1 to run on Windows and Linux without any code changes.

I need functions for colorizing text and background, for clearing screen, for reading key code without showing letter on screen and for moving text cursor to specidied position.

It must be completely free library.

When I try "import curses" on Windows, compiler says me "ImportError: No module named _curses" both on Python 2.6 and 3.1.

도움이 되었습니까?

해결책

In case anyone out there is still looking for a curses solution on Windows, here is a site which has PDCurses-based builds of the standard Python curses module for Windows, and covers a pretty wide range: 32-bit and 64-bit, for Python versions 2.5, 2.6, 2.7, 3.1 and 3.2.

PDCurses is "a public domain curses library for DOS, OS/2, Win32, X11 and SDL".

다른 팁

There is also urwid. http://excess.org/urwid/

See curses-like library for cross-platform console app in python which links to wcurses, a windows library that provides some amount of compatibility with ncurses.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top