1. Register KPI
2. Create KPI report
3. Quit
>>
When you choose 1, you are prompted for name an value of variable.
The menu is displayed when a function called mainmenu is called. Such a menu can be written as follows in Python:
def mainmenu():
print '1: Register KPI'
print '2: Create KPI report'
print '3: Quit'
menuChoice = raw_input('>> ')
Depending on the input the user gives, we cann call different functions (still within mainmenu):
if menuChoice == '1':
regKPI()
elif menuChoice == '2':
createReport()
elif menuChoice == '3':
print 'Goodbye'
else:
print 'Not a valid menu item. Pleast try again'
main()
There you go, a working menu. Next time: we show what the functions regKPI and createReport look like :-)