【发布时间】:2025-12-20 05:00:06
【问题描述】:
我是使用命令提示符的新手,我刚刚从命令提示符执行了我的第一行代码,如下所示:
C:\Users\Michael>python
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello world")
hello world
我现在如何“退出”Python,以便可以运行其他命令,例如cd、cp、ls 等?我知道我可以关闭并打开一个新的命令提示符窗口,但是是否有一个命令可以代替它?
【问题讨论】:
-
哈哈,这真的很有趣。你可以使用
exit()函数。 -
exit()函数或Ctrl+Z -
我惊讶地发现这个有重复;但是无论教程让你走到这一步,肯定也解释了下一步。
标签: python windows terminal command-prompt