我一直在尝试制作一个秒表,我的同事们要求我制作它,但我希望它能够在我在python shell中键入某个键时停止计时器。你知道吗
import time
timer = 0
timeTrueFalse = True
startTimer = input("Type start if you want to start!")
if (startTimer == "start"):
while timeTrueFalse:
timer = (timer + 1)
print (timer)
time.sleep(1)
Tags:
你可以使用时间戳
相关问题 更多 >
编程相关推荐