First time here? Check out the FAQ!
1

View variables in imported module

I'm importing a module containing control variables for a program and I wonder whether there is a way of interrogating them at a breakpoint (as with 'Stack Data')

from pgvars import Pgvars as pgv
.
.
if pgv.value_1 == 'A':
    pgv.Value_2 = '123'
else:
    pgv.value_2 = 'abc'
.
if pgv.value_2 == 'abc'    # breakpoint

at the breakpoint I can display the individual variables in 'debug probe'.

Is there a way of viewing all variables in 'pgv' ?

I feel that this is an elementary question but can't find an answer.

I'm running Python 3.5 on Xubuntu 18.04 using Wing Pro 6.1.2.1

iainrs's avatar
71
iainrs
asked 2018-12-18 14:25:00 -0500
Wingware Support's avatar
4.1k
Wingware Support
updated 2019-03-13 10:24:59 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

There is a Modules tool in the Tools menu that lets you browse data in the same way as Stack Data but starting from sys.modules.  Or, right click on pgv in the editor and select "Watch 'pgv' in Debugger" and then expand it from there.  In the Debug Probe you could also type pgv.dict if pgv is an instance.  That won't work if it's a module, though.

Wingware Support's avatar
4.1k
Wingware Support
answered 2018-12-18 14:53:00 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer