Search code examples
python-3.xspyder

Load spydata file


I'm coming from R + Rstudio. In RStudio, you can save objects to an .RData file using save()

save(object_to_save, file = "C:/path/where/RData/file/will/be/saved.RData")

You can then load() the objects :

load(file = "C:/path/where/RData/file/was/saved.RData")

I'm now using Spyder and Python3, and I was wondering if the same thing is possible.

I'm aware everything in the globalenv can be saved to a .spydata using this :

spyder save load spydata

But I'm looking for a way to save to a .spydata file in the code. Basically, just the code under the buttons.

Bonus points if the answer includes a way to save an object (or multiple objects) and not the whole env.

(Please note I'm not looking for an answer using pickle or shelve, but really something similar to R's load() and save().)


Solution

  • (Spyder developer here) There's no way to do what you ask for with a command in Spyder consoles.

    If you'd like to see this in a future Spyder release, please open an issue in our issues tracker about it, so we don't forget to consider it.