Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object inspections in Python 3.4 IDLE debugger on Windows

I am new to Python. I am using the Python IDLE Debugger on Windows. Is there a way to inspect object attributes in the debugger? The debugger only shows object address/type.

A solution I tried was to create global variables and assign object attributes to them. The debugger then shows global variables. This works for mutable types such as list, but for immutable type such as int, it shows the value at assignment only. Is there a way to bind a global name to a global object's int attribute?

like image 366
Vin Avatar asked Oct 16 '14 21:10

Vin


People also ask

How do I use Python IDLE on Windows?

To execute a file in IDLE, simply press the F5 key on your keyboard. You can also select Run → Run Module from the menu bar. Either option will restart the Python interpreter and then run the code that you've written with a fresh interpreter.

Can I debug Python in IDLE?

The main interface to IDLE's debugger is the Debug Control window, or the Debug window for short. You can open the Debug window by selecting Debug→Debugger from the menu in the interactive window. Go ahead and open the Debug window.

How do I run Python debugger?

Starting Python Debugger To start debugging within the program just insert import pdb, pdb. set_trace() commands. Run your script normally, and execution will stop where we have introduced a breakpoint. So basically we are hard coding a breakpoint on a line below where we call set_trace().


1 Answers

To close the loop on this, based on responses received:

  • IDLE debugger does not support object inspection in the pop-up window
  • Thanks Terry Jan Reedy for putting it on list for future potential improvements. The IDLE is a big help to new Python programmers
like image 119
Vin Avatar answered Sep 24 '22 07:09

Vin