Python
[Python] 연습코딩, thread, timer, input, try
tenn
2013. 12. 18. 00:44
import threading, time
def hello():
i = 0
while i < 5:
i = i + 1
print("hello "+str(i))
time.sleep(1.0)
inp = input("input time? ")
try:
numInp = int(inp)
print("input value : " + inp)
except ValueError:
print("input value is not valid. \n default : 1")
numInp = 1.0
t = threading.Timer(numInp, hello)
t.start()