# if len(sys.argv[1:]) == 0: # sys.argv.append('-h') ARGS = _parse_args() CONFIG = Config() LANG = CONFIG.get_lang_key() if ARGS is not None and ARGS.nox is True: SHELL = Cli() else: SHELL = CONFIG.start_user_profile() if SHELL.interface in ["Tk"]: SHELL.main_window.title({"EN": "asciimation player", "EO": "ASCII bildfilm-komencigilo"}[LANG]) if SHELL.interface in ["wx", "Tk"]: SHELL.center_window(height_=50, width_=180) if SHELL.interface is "Tk": SHELL.msg.destroy() PLAY = tk.Button(SHELL.main_window, text={"EN": "Play", "EO": "Ek"}[LANG], command=lambda: launch_module(CMD_LIST)) PLAY.pack(fill=tk.BOTH, expand=1) elif SHELL.interface is "wx": PANEL = wx.Panel(SHELL.main_window, -1) PLAY = wx.Button(PANEL, -1, "Play", pos=(50, 20)) PLAY.SetDefault() ## Set animation parameters ## ########## # MAIN # ##########
print('\n') # pylint: disable=C0325 sys.exit('Good bye.') label_pile = [str(thing) for thing in things] enum = Enumeration(label_pile, 'Inventory') selection = Cli.make_page( header='Main Menu', obj=str(enum) + Cli.hrule( width=.333, string=True), func=lambda: SHELL.list_menu(MAIN_MENU)) ARGS = _parse_args() CONFIG = Config() if ARGS is not None and ARGS.nox is True: SHELL = Cli() else: SHELL = CONFIG.start_user_profile() if SHELL.interface in ['Tk', 'wx']: SHELL.center_window() MENU_OPTIONS = ['Add a <Thing> to your pile.', 'Hide this menu', 'Discard a <Thing>.', 'Exit'] MAIN_MENU = PlainList(MENU_OPTIONS) if __name__ == '__main__': main()
if sys.argv[1] in ['-h', '--help']: Cli.output(__doc__) #SHELL.main_window.mainloop() sys.exit(0) multiplicend = decimal.Decimal(sys.argv[1]) ans = LONG_PI * multiplicend title_str += '* {} ='.format(multiplicend) elif len(sys.argv[1:]) == 2 and {'-o', '--over'} & set(sys.argv[1:]): dividend = decimal.Decimal(sys.argv[2]) ans = LONG_PI / dividend title_str += '/ {} ='.format(dividend) else: ans = LONG_PI title_str += '= ' #if ans: print(ans) if SHELL.interface == 'Tk': ans_str = str(ans) + '…' SHELL.output(ans_str) msg_width = len(ans_str) * 10 width = msg_width + 40 SHELL.msg.config(width=msg_width) SHELL.center_window(width_=width, height_=50) SHELL.main_window.title(title_str) SHELL.main_window.mainloop()