Variable Explorer not showing Variables from imported source files

7 views
Skip to first unread message

Peter Saunders

unread,
Sep 30, 2021, 9:46:11 PM9/30/21
to spyder
I have split a 1000+ row python source code file into multiple files that I now 'import' as required. These new smaller files define Global Variables used across the whole solution. When running my code in Spyder 5.0.5, I cannot see these Global Variables in the Variable Explorer.

Example:

code1.py

def function1():
    global var1
    var1 = "Hello"

code0.py

import code1 as c1
def do_something():
    c1.function1()
    the_answer = c1.var1 + " Peter"


When running "code0", I want to see both variables in the explorer: the_answer and var1, but I only see the_answer.

How can I do this?
Reply all
Reply to author
Forward
0 new messages