我是靠谱客的博主 坦率铅笔,这篇文章主要介绍怎么退出python,现在分享给大家,希望可以做个参考。

在进入python 后,发现常规的"Ctrl+C"退出不了

C:Userseuweb>python
Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>>
KeyboardInterrupt
>>> ^D
File "<stdin>", line 1
^
SyntaxError: invalid syntax
>>> ^Z
C:Windowssystem32>A
[root@localhost ~]# python3
Python 3.6.8 (default, Jan 19 2022, 23:28:49)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>>

 通过搜索下面文章知晓了推出方式,虽然有些东西没有提示

  • windows中python可以使用exit()或者ctrl+z 退出

  • linux中python可以使用exit()或者使用ctrl+D 退出

使用exit()没试验,有个简单的就好

最后

以上就是坦率铅笔最近收集整理的关于怎么退出python的全部内容,更多相关怎么退出python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部