
没有
report_callback_exception做到这一点:
import tracebackimport tkMessageBox# You would normally put that on the App classdef show_error(self, *args): err = traceback.format_exception(*args) tkMessageBox.showerror('Exception',err)# but this works tootk.Tk.report_callback_exception = show_error如果您没有将“ Tkinter as tk”导入,请执行
Tkinter.Tk.report_callback_exception = show_error
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)