在Python命令行中退出,可以使用exit()
函数或者快捷键Ctrl-D
。
演示代码如下:
$ python
Python 3.7.0 (default, Oct 2 2018, 09:20:07)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
$
或者:
$ python
Python 3.7.0 (default, Oct 2 2018, 09:20:07)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
$
注意,^D
代表Ctrl-D
。