import socket

sock on line 51 and 55 is not defined!!
This commit is contained in:
cclauss
2017-09-19 17:52:23 +08:00
committed by GitHub
parent 8f0a72fcb8
commit d057367fab

View File

@@ -1,5 +1,6 @@
import socket
import time
def countdown(n):
while n > 0:
print('T-minus', n)
@@ -12,10 +13,7 @@ t = Thread(target=countdown, args=(10,))
t.start()
if t.is_alive():
print('Still running')
else:
print('Completed')
print('Still running' if t.is_alive() else 'Completed')
t.join()
@@ -82,4 +80,4 @@ c.start()
import multiprocessing
c = CountdownTask(5)
p = multiprocessing.Process(target=c.run)
p.start()
p.start()