import tkinter as tk
import threading
import time
def count(timeamt):
time.sleep(timeamt)
tk.Label(win, text='5 sec done').grid(row = 0, column = 1)
def start():
t1 = threading.Thread(target=count, args=(5))
t1.start()
# count(5)
tk.Label(win, text = 'started').grid(row = 1, column = 1)
win = tk.Tk()
win.geometry('200x200')
tk.Button(win, text = "hi", command = start).grid(row = 2, column = 5)
win.mainloop()
This is not working
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
TypeError: count() argument after * must be an iterable, not int