Cannot pass arguments from the tkinter widget.after function

后端 未结 3 972
小鲜肉
小鲜肉 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:41

    I would try functools.partial to wrap your call as in:

    widget.after(10, functools.partial(self.runBackup, mybackup))
    

    Or you could define a local function that takes no arguments but passes the parameter (which is in essence what functools.partial does).

提交回复
热议问题