Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 669 Bytes

README.md

File metadata and controls

42 lines (29 loc) · 669 Bytes

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()