def getMenuInfo(self, printerOn=False): gg = [] gg.append(self.op[0]) for i in range(1, self.numoptions): # if i == self.lastPick: mg += ' ~' mg = str(i) + ' ' + self.op[i] gg.append(mg) if printerOn: breakup.show(gg) return gg
def getuserval(msg, printInput=False): print(msg) n = input() f = 1 if msg == '' or msg == ' ': f = 4 try: f = int(n) mg = 'Option entered: ' + n breakup.show(mg) except ValueError: # Handle the exception print('err. Please enter an integer') # i = int( n ) if printInput: f = float(n) print("Value input: ", "{:.2f}".format(f)) return f
def navto(self, a, b): mg = ' navigating from ', str(a), ' --> ', str(b) breakup.show(mg)
def showMenu(self, printerOn=False): gg = self.getMenuInfo() if printerOn: breakup.show(gg) return True ##add a break maybe...
def __init__(self, noptions=5): self.numoptions = noptions if noptions > len(self.op): self.numoptions = len(self.op) # self.showMenu(True) breakup.show(' Acme menu running... ')