def ui(): cmd=main_menu() while cmd<> "exit": if cmd=="operation": operations() elif cmd=="conversion": conversions() else: print "No such command" cmd=main_menu()
def ui(): cmd = main_menu() while cmd <> "exit": if cmd == "operation": operations() elif cmd == "conversion": conversions() else: print "No such command" cmd = main_menu()
def conversions(): """ user interface for conversions """ cmd=conv_menu() while cmd<>"back": if cmd=="subst": base=validate_base() dest=validate_dest() number=valid_op(base) try: rez=substitution(int(base),int(dest),number) except ValueError,msg: print msg conversions() elif cmd=="successiv": base=validate_base() dest=validate_dest() number=valid_op(base) try: rez=successiv(int(base),int(dest),number) except ValueError,msg: print msg conversions()
def conversions(): """ user interface for conversions """ cmd = conv_menu() while cmd <> "back": if cmd == "subst": base = validate_base() dest = validate_dest() number = valid_op(base) try: rez = substitution(int(base), int(dest), number) except ValueError, msg: print msg conversions() elif cmd == "successiv": base = validate_base() dest = validate_dest() number = valid_op(base) try: rez = successiv(int(base), int(dest), number) except ValueError, msg: print msg conversions()
number=valid_op(base) try: rez=successiv(int(base),int(dest),number) except ValueError,msg: print msg conversions() elif cmd=="inter": base=validate_base() dest=validate_dest() inter=validate_inter() number=valid_op(base) try: rez=intermediate(int(base),int(inter),int(dest),number) except ValueError,msg: print msg conversions() elif cmd=="rapid": base=valid_rapid() dest=validate_dest() number=valid_op(base) try: rez=rapid(int(base),int(dest),number) except ValueError,msg: print msg conversions() elif cmd=="back": ui() else: print "No such command" conversions() print result(convert_from(rez))
number = valid_op(base) try: rez = successiv(int(base), int(dest), number) except ValueError, msg: print msg conversions() elif cmd == "inter": base = validate_base() dest = validate_dest() inter = validate_inter() number = valid_op(base) try: rez = intermediate(int(base), int(inter), int(dest), number) except ValueError, msg: print msg conversions() elif cmd == "rapid": base = valid_rapid() dest = validate_dest() number = valid_op(base) try: rez = rapid(int(base), int(dest), number) except ValueError, msg: print msg conversions() elif cmd == "back": ui() else: print "No such command" conversions() print result(convert_from(rez))