0

I want to convert this code to a threading and modify it with another program.

from tkinter import *
from time import sleep

def wink(self):
    self.configure(bg = "White")
    self.configure(fg = "Black")
    self.update()

    sleep(0.2)

    self.configure(bg = "Black")
    self.configure(fg = "White")
    self.update()

root = Tk()
alabel = Label(root, text = "welcome to my app", bg = "Black", fg = "White")
alabel.pack()
root.mainloop()

I want to call this as a threading and call wink in another program to make a change on my page.

I want my program to call this code while it is running and call wink at the right time to make a change on the page, without stopping my program*

YOTYTEAM
  • 17
  • 1
  • 5
  • with simple threading you would `import threading` and then say `threading.Thread(target=wink).start()` but since there are no buttons or something, im not clear how you would proceed with this code. – Delrius Euphoria Sep 04 '20 at 11:51
  • You can look at this to get the idea, note that the OP uses a diffrent working solution and there are links for another solution as links for a deeper understanding. https://stackoverflow.com/questions/63414254/tkinter-gui-i-o-threading-when-to-use-queues-when-events/63416839#63416839 – Thingamabobs Sep 04 '20 at 13:54

0 Answers0