Spyder: Script has no access to variables in IPython console?

Created on 14 Feb 2020  路  1Comment  路  Source: spyder-ide/spyder

In Spyder, my script seems to have no access to the variables that are currently in the workspace?

When I repeatedly run the following script:

try:
    name
except NameError:
    print('name is not defined')

name = 'hello'

Then 'name is not defined' is printed in the IPython console every time I execute the script. However, I can see the variable in the variable explorer, and I can access it in the IPython console.

This didn't use to be this way?!?!

I am running:

Python 3.7.3 [MSC v.1915 64 bit (AMD64)]
IPython 7.12.0
Spyder 4.0.4

Most helpful comment

To change that you need to go to the menu

Run > Configuration per file

and activate the option called Run in console's namespace instead of an empty one.

>All comments

To change that you need to go to the menu

Run > Configuration per file

and activate the option called Run in console's namespace instead of an empty one.

Was this page helpful?
0 / 5 - 0 ratings