python当前会话未在命令lin处退出

2024-03-29 15:35:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试学习python,我已经通过命令行运行了简单的hello函数,但当我尝试使用下面的命令退出当前会话时,它会给我一个新行,但不会在项目文件夹路径中再次运行。你知道吗

命令:

CTRL+C

请任何人都可以分享所有命令和参考教程网站,给我的所有想法的代码在python3最新版本。你知道吗


Tags: 项目函数代码命令行命令路径版本文件夹
3条回答

运行quit()退出。Ctrl+C只取消当前输入。你知道吗

来源

interpreter documentation

Typing an end-of-file character (Control-D on Unix, Control-Z on Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn’t work, you can exit the interpreter by typing the following command: quit().

interactive mode documentation

Typing the interrupt character (usually Control-C or Delete) to the primary or secondary prompt cancels the input and returns to the primary prompt.

要退出Python解释器,可以运行exit()或键盘快捷键CTRL+D

Python解释器中的CTRL-C是KeyBoard Interrupt。要退出Python解释器,请运行exit()。Python解释器文档是here。你知道吗

相关问题 更多 >