如何在 PyCharm 中取回调试控制台? [英] How to get back Debug Console in PyCharm?

查看:46
本文介绍了如何在 PyCharm 中取回调试控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果 PyCharm 中的调试控制台没有显示,如何恢复它?我发现如果我重新调试它就会恢复,但除此之外,还有其他方法吗?

How can one restore the Debug Console within PyCharm if it is not showing? I've found it comes back if I restart debugging but outside of this, is there any other way?

我一直在阅读文档并搜索了很多答案,但到目前为止还没有找到方法.

I've been reading the docs and searching quite a bit for the answer but so far have not found a way.

下面的动画图片显示调试控制台在屏幕底部打开,稍后在同一张图片中它也显示为关闭状态.如果关闭了,有没有办法在不开始新的调试运行的情况下恢复它?

The animated image below shows the debug console open in the bottom part of the screen, and also later on in the same image it appears closed. If this is closed, is there a way to get it back without starting a new debug run?

推荐答案

请注意,有两种不同的方式来使用和启动控制台.

Notice there are two different ways to use and launch the console.

A.一种是使用 Alt + Shift + E 通过调用 C:JetBrainsPyCharm 2020.1.1pluginspythonhelperspydevpydevconsole.py 来启动控制台它与任何文件或项目相关联.这种方式在View > Tool Windows > Python Console.

A. One is using Alt + Shift + E which launches the console by calling C:JetBrainsPyCharm 2020.1.1pluginspythonhelperspydevpydevconsole.py without it being associated to any file or project. This way has its own Tool Window in View > Tool Windows > Python Console.

B.另一种方法是通过按 Shift + F9(或 Alt + Shift + F9)运行调试配置,这会在 C:JetBrains 启动调试器进程PyCharm 2020.1.1pluginspythonhelperspydevpydevd.py 并将其与运行配置的脚本相关联.这也使用了单独的工具窗口 View > Tool Windows > Debug(Alt + 5).

B. The other way is running a debug configuration by pressing Shift + F9 (or Alt + Shift + F9), this launches the debugger process at C:JetBrainsPyCharm 2020.1.1pluginspythonhelperspydevpydevd.py and does associate it with the script of your run configurations. This also uses a separate Tool Window View > Tool Windows > Debug (Alt + 5).

如果关闭了,有没有办法在不开始新的调试运行的情况下恢复它?

If this is closed, is there a way to get it back without starting a new debug run?

是的,选择使用 Python 控制台运行";在运行/配置中.在调试器完成调试器窗格"中的控制台后,持续存在.

Yes by choosing "Run with Python Console" in the Run/Configurations. After the debugger finishes the Console in the "Debugger Pane" persists.

打开它会很有用,因为控制台可以包含上次完成运行的日志

And it can be useful to have it on because the Console can contain logs from the last completed run

我没有注意到这一点,但命令历史实际上是在 2 个控制台窗口之间共享的.因此,如果您单击浏览查询历史记录";你可以从一个窗口到另一个窗口.

I hadn't noticed this, but the command history is actually shared between the 2 console windows. So if you click the "Browse Query History" you have it available from one window to the other.

这篇关于如何在 PyCharm 中取回调试控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆