Cannot pass arguments from the tkinter widget.after function

后端 未结 3 964
小鲜肉
小鲜肉 2020-12-19 10:14

Part of the GUI I\'m building using tkinter has a pop-up window that says \"Please wait while the program is running.\" then after it finishes the window goes away. I\'m usi

3条回答
  •  感情败类
    2020-12-19 10:27

    Add: Using Lambda function format, the function doesn´t fail after several recursive calls. eg:

    Function abc(par):
               stat-1
               stat-2
               ...
               stat-n
               root.after(1000, lambda : abc(par))
    
        ...
    

    (it´s very useful to update a time-clock at left-top of window, for example...)

提交回复
热议问题