gpt4 book ai didi

python - Pycharm 中的命令窗口

转载 作者:太空宇宙 更新时间:2023-11-03 12:45:35 25 4
gpt4 key购买 nike

Pycharm 中是否有一个界面,我们可以简单地输入一些命令并运行它?类似于在 Matlab 中,我们可以输入“a = 1; b = 2; c = a+b”然后我们得到 ans=3。

谢谢PS:我们知道我们可以在 Pycharm 中创建一个 python 文件并运行它,例如,“a = 1; b = 2; c = a+b; print(c)”,但它不如命令窗口方便。

最佳答案

来自文档的简短回答:

To launch an interactive console On the main menu, choose Tools | Run Python console.

描述:

REPL console

PyCharm also helps those who love the full control of an interactive console: on the Tools menu, you can find commands that launch the interactive Python or Django consoles. Here you can type commands and execute them immediately. Moreover, PyCharm's interactive consoles feature syntax highlighting, code completion, and allow viewing the history of commands (Ctrl+Alt+E or Up/Down arrows while in the editor).

PyCharm also makes it possible to run in console source code from the editor — just make your selection, and then press Shift+Alt+E (Execute selection in console on the context menu of the selection).

独立于 Pycharm,您还可以通过键入

在终端(或 Windows 上的 cmd shell)中访问 REPL
python

在提示符下。

关于python - Pycharm 中的命令窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37017245/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com