Stop at the line where a variable gets changed(停在变量被改变的那一行)
问题描述
我正在尝试追踪变量何时更新.我有一个观察者,但有什么方法可以设置它,以便在值更新时暂停执行?
I am trying to track down when a variable gets updated. I have a watcher, but is there any way to set it up so that the execution can be paused when the value is getting updated?
这称为观察点或数据断点.
推荐答案
目前pycharm没有实时跟踪变量修改的默认内置功能.或者,您可以这样做:
Currently pycharm does not have a default built-in feature that tracks variable modification in real time. Alternatively you can do this:
- 运行调试
- 在调试器窗格 -> 变量中,右键单击要跟踪的变量并将其添加到 Watches.
- 在 Watches 窗格中,右键单击变量并选择引用对象.
我相信您所说的功能称为观察点支持,根据这篇文章:http://sourceforge.net/blog/watchpoints-in-python/Eric 和 PyScriptor 有这个功能,但 pycharm 没有.
The feature you are talking about is, I believe, called watchpoint support and according to this article: http://sourceforge.net/blog/watchpoints-in-python/ Eric and PyScriptor has the feature but not pycharm.
这篇关于停在变量被改变的那一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:停在变量被改变的那一行


基础教程推荐
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 筛选NumPy数组 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01