first threading version

This commit is contained in:
2017-10-31 17:25:52 +01:00
parent f9f2bfcdd7
commit e2fcb44601
2 changed files with 79 additions and 37 deletions
+22
View File
@@ -0,0 +1,22 @@
import threading
from threading import Thread
import time
def func1():
for x in range(0, 3):
print('Working 1')
time.sleep(1)
def func2():
for x in range(0, 3):
print('Working 2')
time.sleep(1)
if __name__ == '__main__':
Thread(target = func1).start()
Thread(target = func2).start()
for x in range(0, 3):
print('Working MAIN')
time.sleep(1)