Hi,

To have access to the console namespace when running a file, you need to go to the menu

    Run > Configuration per file

then select the option called "Run in console's namespace instead of an empty one" and finally re-run your file again.


Cheers,
Carlos

El 6/01/20 a las 11:32 a. m., LeeEtchels escribió:
Hi all, apologies if this has an obvious fix.

I'm working in Spyder 4 and python 3.7.

If I create a variable in a script (for example a = 5), run it, and then type a into the console it will give back the value 5.

If I create a variable in the console in the same way and then reference it in a script in the editor I get a NameError saying that it hasn't been defined.

The same happens if I run a script from the editor twice, the second run through is incapable of seeing the variables created on the first run (although it can obviously be recreated/defined).

The reason I am trying to work this way is that I am reading in a dataset from a spreadsheet, which takes a while, and then creating plots using the library Bokeh. Once I've read the data in once I want to be able to keep working on the script, making changes and re-running to get all the plots working how I like, without having to import all the raw data again but at the moment the only way I can reference the data that is shown in the variable explorer is through the console.

I'm sure I used to do this in Spyder 3 before I had to get my pc wiped and everything re-installed, but I could be wrong about that.

Is there a setting somewhere that I need to change? I've looked in the preferences but couldn't see anything that I understood as being related...

Thanks very much for any help,
Lee
--
You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/24ed2b31-0769-4f1e-b1d4-b97c1c2a3fc2%40googlegroups.com <https://groups.google.com/d/msgid/spyderlib/24ed2b31-0769-4f1e-b1d4-b97c1c2a3fc2%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/spyderlib/1c7e1134-8efc-ffcc-acbf-a37c1c686818%40gmail.com.

Reply via email to