示例#1
0
 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
示例#2
0
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
示例#3
0
 def navto(self, a, b):
     mg = ' navigating from ', str(a), ' --> ', str(b)
     breakup.show(mg)
示例#4
0
 def showMenu(self, printerOn=False):
     gg = self.getMenuInfo()
     if printerOn: breakup.show(gg)
     return True  ##add a break maybe...
示例#5
0
 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... ')