原创不易
主要运用了threading,time和easygui
接下来看代码吧
import time from threading import Thread from easygui import buttonbox def msgbox(msg="(Your message goes here)", title=" ",ok_button="OK",image=None,root=None,run=True,timeout=None): result=buttonbox(msg=msg,title=title,choices=[ok_button],image=image,default_choice=ok_button,cancel_choice=ok_button,run=run) if run or not(timeout): print(1) return result else: def Timer(): time.sleep(timeout) result.stop() Thread(target=Timer).start() msgbox(run=False,timeout=10)
最后
以上就是火星上乌冬面最近收集整理的关于关于Easygui中Msgbox()函数的改良(超时(Timeout参数)自动关闭弹窗)的全部内容,更多相关关于Easygui中Msgbox()函数内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复