Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🧐 Easily inspect/visualize objects and variables in your running python code in real time.

License

NotificationsYou must be signed in to change notification settings

richstokes/python-objectviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debugging tool thats lets you easily inspect/visualize objects and variables in your running python code as a tree view.

It uses the Debug Adapter Protocol (DAP) to retrieve the objects in your running python program. It then displays them in a web app.

Every time you refresh the page, it briefly pauses your running code and displays a snapshot of its current state.

Screenshot

Setup

On the project you wish to debug, installdebugpy:
pipenv install debugpy

Start debugpy server

From the project you with to debug:

pipenv run python -m debugpy --listen localhost:5678 your-script.py

Run python-objectviewer

In another terminal, clone this repo and run:HD_PORT=9000 pipenv run python pov.py

Then open your browser athttp://localhost:9000

 

Notes

By default this will grab the variables of the running program at the time you load/reload the python-objectviewer page. I like this for long-running programs / those that are running in an infinite loop; a quick refresh of this tool and it'll snapshot the current state without needing any modifications of the target program.

If you want to capture the state more precisely you can do something like this in your target program:

# At the start of your programdebugpy.wait_for_client()# At the point in the code you want to capturedebugpy.breakpoint()

The code will then pause at the breakpoint until this tool connects and takes a snapshot of its current state.

About

🧐 Easily inspect/visualize objects and variables in your running python code in real time.

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp