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.

No comments: