Let's say this:

print """
Wleomce...
* To start the quiz press <s>
* For more information quiz press <i>
* To exit press <q>
"""
main_menu = raw_input('Your choice: ').lower().strip()
if mai_menu == 's':
	print """\
	* Press <n> to write yoyr name.
	* Press <l> to choice your level.
	* Press <b> to go back to the main menu.
	"""
...
...
..

I want to control the menu as this psuedocode:

press <m> to go back to the main menu
press <l> to go back to the level menu
...
..

Recommended Answers

All 4 Replies

First you need a good organized class to control the menu levels. This shoud at least give you an idea.
1. You need the menu navigation class (a,b,c,d) etc menus
2. You need menu level navigation class inheriting the menu class. (Back,forward,up,down) etc
3. You need action class inheriting the menu level navigation class. (And action of any kind) etc

Draw you thinking on paper first, have a working idea before you even try to hit your keyboard.
Adios !

Yeah... It's really hard to make it like this.

I'll try :)

Yeah... It's really hard to make it like this.

I'll try :)

I once wrote a primitive class for such applications. It could be sufficient if your program is small enough. See here http://www.daniweb.com/code/snippet217215.html

Thank's... It's really interesting like this :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.