# 捕捉KeyboardInterrupt错误 import time try: while True: print("你好") time.sleep(1) except KeyboardInterrupt as results: print(results) finally: print("怎么了") print("好!")