所以我想抓住KeyboardInterrupt全球,并妥善处理它.我不想把我的整个脚本包含在一个巨大的try/except语句中,因为这听起来很糟糕.有没有办法做到这一点?
KeyboardInterrupt
python exception
exception ×1
python ×1