How do I change a value while debugging python with pdb?

心不动则不痛 提交于 2019-12-03 10:42:31

This appears to be a bug in Python 2.6. You should be able to do this in Python 2.7.

Actually, the value of the variable does get changed when you assign a new value in pdb. But if you try to read the variable in pdb again without running your code, it may reset to the original value.

If you step back into your code, you should see that it will use your new value (-40).

Try this:

stationLat = -40
s # step back into code
stationLat # should display -40
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!