从 Python 命令行退出

Vaibhav Vaibhav 2022年5月17日
从 Python 命令行退出

Python 解释器可以通过键入 python 从任何命令行激活。一旦激活,它就可以用来编写代码并运行它。一旦解释器启动,除非我们退出 Python 解释器,否则不能使用通常的命令行实用程序。有几种方法可以退出 Python 解释器。这篇文章讨论了它们。

退出 Python 解释器的方法

以下是退出 Python 解释器的方法。

  1. 输入 exit():注意是 exit() 而不是 exit。这是一个函数调用。
  2. 在 Windows 上,使用组合键 Ctrl + Z + Enter
  3. 在 UNIX 系统上,使用组合键 Ctrl + D
Vaibhav Vaibhav avatar Vaibhav Vaibhav avatar

Vaibhav is an artificial intelligence and cloud computing stan. He likes to build end-to-end full-stack web and mobile applications. Besides computer science and technology, he loves playing cricket and badminton, going on bike rides, and doodling.

LinkedIn GitHub