Monday, April 7, 2014

A curses menu library in Python

Curses Menu Library in Python

Just posted on Google Code a "curses menu library" ;

My little application (also on Google Code) to mimic the digital rain in the movie Matrix  using curses was a little warm-up for something a bit more interesting.

I'm working on the menu of the "call-centre Management" made even earlier - that will offer the menu option of creating a new Game, giving a list of the staff, hiring (and firing) agents, and Inspect them while they're working...

About this Menu library

It works as a standalone program - a demo of sort.
But it is more useful to import it in other program. Just make sure the is in the same directory as your source file and then add this line in the import section:

from menulib import run_menu

and in your main program you can then declare a menu as a list :

main_menu = [ "New File", "Edit", "Search", "Exit"]

The last option has to be the one exiting the program

Then in the main function add
and then add all the conditions to handle the option returned from the menu.

Friday, April 4, 2014

Python new code update and useful links

Some modifications

Since my last post - I've changed a few lines of code, because it wasn't using the "wrapper" function that I understand is a good practice when using the curses library.

Otherwise when debugging sometime the terminal is rendered unusable (typing characters aren't showed, the sequence would only appear after pressing the return key) - the remedy is to type (blindly) stty sane and pressing enter hoping there was no typo ...


Hosted on google code

The project is now both on and



Here's my bookmarks for Python :

Very useful on how to use the curses library - helped me a lot to understand how to implement :

Very useful tool to understand (by visualization) Python "funky" syntax like :
list1 = list0[:]
x, y = 10, 14

Great list of online Python courses on Codecademy

Interactive online Python console lab from Codecademy

For later use (I'm not there yet) :