当前位置: 首页>>代码示例>>Python>>正文


Python Dialog.autowidgetsize方法代码示例

本文整理汇总了Python中dialog.Dialog.autowidgetsize方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.autowidgetsize方法的具体用法?Python Dialog.autowidgetsize怎么用?Python Dialog.autowidgetsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dialog.Dialog的用法示例。


在下文中一共展示了Dialog.autowidgetsize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Dialog

# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import autowidgetsize [as 别名]
#! python3 # this probably doesn't work. I could make it work for UNIX-like stuff, but nooooo we gotta use Windows
from header import *
from dialog import Dialog
from random import randrange
#  import multiprocessing as mp
version = 0.0

d = Dialog(dialog="dialog")  # change this to point to your dialog install if it is not in $PATH
d.set_background_title("PhysTools version "+str(version)+" :D")
d.autowidgetsize = True

#  cpu_count = mp.cpu_count()  # for future multithreading, possible Julia delegation

# are you ready for the ugliest function you've ever seen? get hype
# if you're just starting out go look at the header file, it actually has useful stuff and is organized
while True:  # this whole thing is probably hacky af, especially with flow control

    code, tag = d.menu("Choose an option. Charge units are "+chargeUnit.describe()+" and angle units are "+
                       angleUnit.describe()+".",
                       choices=[("Help", "show help information"),
                                ("Print", "print the active objects"),
                                ("Add", "add an object"),
                                ("Remove", "remove an object"),
                                ("Test", "test the field at a point"),
                                ("Configure", "set options and modes"),
                                ("Save", "save the active objects"),
                                ("Load", "load objects from a file"),
                                ("Exit", "exit")],
                       title="Main Menu")

    if code != d.OK or tag == "Exit":
开发者ID:idajourney,项目名称:PhysTools,代码行数:33,代码来源:main.py


注:本文中的dialog.Dialog.autowidgetsize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。