Hi,
I never used this function, but I think you have a good point here. It couldn’t find any documentation regarding this .spydata file format, and it might as well be described how to use it using both the GUI and a script (maybe a public spyder function of some sort can be used/created for this?). This is what I figured out: it is tarfile containing some (only 1?) pickled python dictionary containing the workspace variables.
As a small example, this is how you can load a *.spydata file (based on load_dictionary() in spyderlib/utils/iofuncs.py):
# a naive and incomplete demonstration on how to read a *.spydata file
import pickle
import tarfile
# open a .spydata file
filename = 'test.spydata'
tar = tarfile.open(filename, "r")
# extract all pickled files to the current working directory
tar.extractall()
extracted_files = tar.getnames()
for f in extracted_files:
if f.endswith('.pickle'):
with open(f, 'rb') as fdesc:
data = pickle.loads(fdesc.read())
# or use the spyder function directly:
from spyderlib.utils.iofuncs import load_dictionary
data_dict = load_dictionary(filename)
I went ahead and created an issue for this here: http://code.google.com/p/spyderlib/issues/detail?id=1693
Regards,
David
--
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 spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at https://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.