Skip to content

Commit f080541

Browse files
author
krsm
committed
fixing indentation
1 parent 4793888 commit f080541

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Multithreading/stdy_threads.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@
77
import _thread as thread
88
import time
99

10+
1011
# Example 1
1112
def son(tid):
1213

1314
print("Executing son", tid)
1415

16+
1517
def father():
1618

1719
k = 0
1820
while True:
1921
k = k + 1
2022
thread.start_new_thread(son, (k,))
21-
if input() == "q":break
23+
if input() == "q": break
2224

2325

2426
# Example 2
2527
def counter(myId, count):
2628
for i in range(count):
2729
time.sleep(1)
28-
print('[%s] => %s' % (myId,i))
30+
print('[%s] => %s' % (myId, i))
2931

3032
if __name__ == "__main__":
3133

@@ -34,7 +36,7 @@ def counter(myId, count):
3436

3537
# Example 2
3638
for i in range(5):
37-
thread.start_new_thread(counter,(i,5))
39+
thread.start_new_thread(counter, (i, 5))
3840

3941
time.sleep(5)
4042
print("Exiting main thread")

0 commit comments

Comments
 (0)