File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,18 @@ pipenv run python -m debugpy --listen localhost:5678 your-script.py
2626In another terminal, clone this repo and run:
2727` HD_PORT=9000 pipenv run python pov.py `
2828
29- Then open your browser at [ http://localhost:9000 ] ( http://localhost:9000 )
29+ Then open your browser at [ http://localhost:9000 ] ( http://localhost:9000 )
30+
31+
32+ ## Notes
33+ By default this will grab the variables of the running program at the time you load/reload the python-objectviewer page.
34+
35+ If you want to capture the state more precisely you can do something like this in your target program:
36+
37+ ``` python
38+ # At the start of your program
39+ debugpy.wait_for_client()
40+
41+ # At the point in the code you want to capture
42+ debugpy.breakpoint()
43+ ```
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ def render_variable_tree(variables):
4949 if var_type in VARIABLE_TYPES_TO_FILTER :
5050 continue
5151
52+ # Truncate long values
53+ if len (value ) > 100 :
54+ value = f"{ value [:100 ]} ..."
55+
5256 # Render one node for the variable
5357 with hd .scope (v ):
5458 # print(f"DEBUG: Rendering variable: {name} with value: {value}")
You can’t perform that action at this time.
0 commit comments