简体   繁体   English

在调试模式下以python打印变量值(pycharm是IDE)

[英]to print the variable values in python in debug mode ( pycharm is the IDE)

I want to print the value of variable on the pycharm console while in the debug mode in python. 我想在python的调试模式下在pycharm控制台上打印变量的值。 How can i achieve this? 我怎样才能做到这一点?

Debug mode in PyCharm has two sections, debugger and console : PyCharm中的调试模式有两个部分, 调试器控制台

在此处输入图片说明

Debug shows you the variables in memory, and console shows the output of your code. Debug向您显示内存中的变量,而Console向您显示代码的输出。 Additionally, if you're at a breakpoint you can print variables out or interact with them in the debug console . 此外,如果您处于断点,则可以打印出变量或在调试控制台中与变量进行交互。 Click on the second-last icon here 单击此处倒数第二个图标
在此处输入图片说明
while in debug mode. 在调试模式下。 (If you don't see it, try enlarging the bottom debugging area upwards.) (如果看不到它,请尝试向上扩大底部调试区域。)

If you still can't find it, look for a console icon on the top right - sometimes the console gets hidden for some reason. 如果仍然找不到,请在右上角找到控制台图标-有时由于某种原因控制台被隐藏了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM