首页 > 技术文章 > python终止代码运行

jaysonteng 2020-03-24 23:30 原文

方法一:

import sys

sys.exit()  # 退出当前程序,但不重启shell

方法二:

exit()  # 退出当前程序,并重启shell

 

方法三:

quit()  # 与exit()效果一样,退出并重启shell

推荐阅读