How to run a function in the background of tkinter

后端 未结 5 2155
独厮守ぢ
独厮守ぢ 2021-01-04 21:48

I am new to GUI programming and I want to write a Python program with tkinter. All I want it to do is run a simple function in the background that can be influenced through

5条回答
  •  耶瑟儿~
    2021-01-04 22:14

    If you don't want to be away from those threads, I would like to give one suggestion for your GUI- Place the function for your GUI just before the root.mainloop() statement.

    Example-

    root = tk.Tk()
    .
    .
    graphicsfunction()     #function for triggering the graphics or any other background 
                           #function
    root.mainloop()
    

    Please up vote if you like.

提交回复
热议问题