From c610762522a1feffa220dc9736c57c6dd3e613c6 Mon Sep 17 00:00:00 2001 From: cheezedoodle2 Date: Thu, 6 Apr 2023 17:02:42 -0700 Subject: [PATCH] Added threading example. --- test24.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test24.py diff --git a/test24.py b/test24.py new file mode 100644 index 0000000..09e74ae --- /dev/null +++ b/test24.py @@ -0,0 +1,19 @@ +from threading import Thread +from time import sleep +import tkinter as tk + +def hello(): + i = 1 + while i < 10: + print(f"Hello {i}") + i += 1 + sleep(1) + +t1 = Thread(target = hello) +t2 = Thread(target = hello) + +#t1.start() +#t2.start() + +tk.Tk() +sleep(10) \ No newline at end of file