Pygcurse(pronounced 'pig curse') is a curseslibrary emulator that runs on topof the Pygame framework.It provides an easy way to create textadventures, roguelikes,and console-style applications. Themascotof Pygcurse is a blue pig with a skull tattoo on its butt.
![Python Ncurses Windows Python Ncurses Windows](/uploads/1/2/6/9/126907736/502618252.png)
Yes.But unfortunately,the cursesmodule that comes with the Python standard library does notwork on Windows. The excellent Consolemodule from effbot providescurses-like features, but it only runs on Windows and not Mac/Linux. Byusing Pygame, Pygcurse is able to run on all platforms. Also, sincethis curses-like module is built on top of Pygame, your programs arenot strictly limited strictly to text characters. You can use all thenormal Pygame drawing and graphics functions, as well as any librariesmade for Pygame.
Pygcurse provides several benefits over normal text-basedstdio programs:
- Color text and background.
- The ability to move the cursor and print text anywhere inthe console window.
- The ability to make console apps that make use of the mouse.
- Theability to have programs respond to individual key presses, instead ofwaiting for the user to type an entire string and press enter (as isthe case withinput()/raw_input()).
- The ability to use any font and any character in thosefonts.
- Since the console window that Pygcurseuses is just a Pygame surface object, additional drawing andtransformations can be applied to it. Multiple surfaces can also beused in the same program.
Pygcurse also provides some additional features that cursesnormallydoesn't, such as tinting, shadows, textboxes, and line drawingfunctions.
For Python 3.5 support, you will need to check VC 2015.3 v140 toolset for desktop (x86,x64) during installation. Note: It is a good idea to install older compilers before newer ones. See the Troubleshooting section. Install Python 3.3 or later to get the Python launcher for Windows. Install any other Python versions you want to build wheels for. A certain class of Python applications works best with an interactive user interface without the overhead or complexity of a graphical environment. For interactive text-mode programs (under Linux/UNIX), for example, the ncurses library, wrapped in Python's standard curses module, is just what you need. 20 videos Play all Python curses Module Tutorials John Hammond Gravity explained - visualized (it will blow your mind) - Duration: 9:08. Meta tome 674,391 views. The above import will work fine for Linux based systems, to make it compatible for windows you need to install curses. To do this you need to download curses for windows according to your python version from python extension packages and then run the following command. UniCurses is a wrapper for Python 2.x/3.x that provides a unified set of Curses functions on all platforms (MS Windows, Linux, and Mac OS X) with syntax close to that of the original NCurses. To provide the Curses functionality on Microsoft Windows systems it wraps PDCurses. This document is intended to be an 'All in One' guide for programming with ncurses and its sister libraries. We graduate from a simple 'Hello World' program to more complex form manipulation. No prior experience in ncurses is assumed. Send comments to this address.
Pygcurse requires Pygame to be installed. Pygame can bedownloaded from http://pygame.org.Pygcurse can be used with either Python 2 or Python 3.
If you make your own games with Pygcurse, then send them to @Pygcurse to be publicized!
pygcurse_src.zip,38KB (Requires Python 2 or 3 and Pygame to be installed.)Simply download the pygcurse.py file and import pygcurse tomake use of it. The download comes with several demo programs.
You can also pull the files off of github: https://github.com/asweigart/pygcurse
Ncurses Windows Port
Ncurses Newwin
Pygcurse is available under a Simplified BSD License.There is a tutorialfor Pygcurse where you can learn how to use it.
Ifyou don't know how to use Pygame (or Python or programmingin general), there is a Pygametutorial in the free book 'Invent Your OwnComputer Games with Python' |
DodgerGame (source, Windows exe) | MazeGame (source, Windows exe) |
TextrisGame (source, tetrisb.mid, tetrisc.mid, Windows exe) | TextboxTest (source) |
ShadowTest (source) | TicTac Toe Game (source) |
ReversiGame (source) |