Skip to content

ednakatani/MenuMaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MenuMaker

A simple terminal based menu for python applications.

image

Code Example: basic calculator

Importing the package:

import menumaker

Defining the functions:

def sum():
    a = int(input('a: '))
    b = int(input('b: '))
    print(a+b)
    return a+b

def multiply():
    a = int(input('a: '))
    b = int(input('b: '))
    print(a*b)
    return a*b

Initializing the Menu class:

m = menumaker.Menu("CALCULATOR",True,False,True ,[["Sum",sum],["Multiply",multiply]])

Running:

m.menu()