We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents adafe86 + c7ea307 commit 88216eaCopy full SHA for 88216ea
1 file changed
Week07/threaded_esra_kaya.py
@@ -0,0 +1,13 @@
1
+import threading
2
+def threaded(n):
3
+ def decorator(func):
4
+ def wrapper(*args, **kwargs):
5
+ threads = []
6
+ for i in range(n):
7
+ t = threading.Thread(target=func, args=args, kwargs=kwargs)
8
+ threads.append(t)
9
+ t.start()
10
+ for thread in threads:
11
+ thread.join()
12
+ return wrapper
13
+ return decorator
0 commit comments