python 如何手动实现阻塞?
令py脚本一直阻塞直到强制退出(KeyboardInterrupt)
之前用
while True: pass
发现cpu占用太高了。。。
while True: time.sleep(1)
while True: # 等待一年 time.sleep(60*60*24*365) # 直接等待一百年 time.sleep(60*60*24*365*100)
condition=threading.Condition() condition.acquire() condition.wait()
Python实现按任意键继续