## das muss in idlelib.PyShell in die letzten Zeilen der Klasse
## this must be copied to idlelib.PyShell into the last lines of the class
############################# adds by nicco kunzmann #########################
__nk___init__= __init__
def __init__(self, *args, **kw):
self.__nk___init__(*args, **kw)
self.__nk_writelist= []
self.__nk_act_act_write()
__nk_write= write
def write(self, *args):
self.__nk_writelist.append(args)
def __nk_act_act_write(self):
try:
while self.__nk_writelist:
args= self.__nk_writelist.pop(0)
try:
self.__nk_write(*args)
except:
traceback.print_exception(*sys.exc_info())
print args
finally:
self.text.after(1, self.__nk_act_act_write)
############################# adds by n.k. the end #########################
我认为您正在使用空闲的Python shell和线程。如果我错了,请纠正我。你知道吗
有时这会导致Tkinter/怠速崩溃。你知道吗
下面是我在2008年编写的一些代码,用于防止Python Shell在使用线程时崩溃。你知道吗
相关问题 更多 >
编程相关推荐