import uos import vga2_bold_16x16 as font import tftui def main(ui): fs_stat = uos.statvfs('/') fs_size = fs_stat[0] * fs_stat[2] fs_free = fs_stat[0] * fs_stat[3] ui.cls() ui.center("System Size",0) ui.center("{:,}".format(fs_size), 1) ui.center("Free Space", 3) ui.center("{:,}".format(fs_free), 4) ui.center("Press to", 6) ui.wait("Continue", 7) main(tftui.UI(font)) __import__("menu") # return to turtleplotbot menu
else: __import__(mod_name) def main_menu(uio): """ show user main menu and call method based on selection """ menu = [("Connect to AP", connect_ap), ("Disconnect AP", disconnect_ap), ("Enable AP", enable_ap), ("Disable AP", disable_ap), ("Run Program", run_program), ("Quit", None)] option = 0 while True: option = uio.menu("DrawBot Menu", menu, option, 0) if option not in [None, 5]: if callable(menu[option][1]): menu[option][1](uio) else: uio.cls("Exiting", 1) uio.center("to", 2) uio.center("REPL", 3) uio.center("Press to", 5) uio.wait("Continue", 6) uio.cls() break main_menu(tftui.UI(font)) sys.exit()
""" import vga2_bold_16x16 as font import tftui def main(ui): """ Main routine """ menu = [ "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" ] option = 0 while option is not None: option = ui.menu("Pick a Number", menu, option) if option: ui.cls("You Picked:", 2) ui.center(menu[option], 3) ui.center("Press to", 5) ui.wait("Continue", 6) ui.cls("Bye!") main(tftui.UI(font, 1)) __import__("menu") # return to turtleplotbot menu