Thanks David for going deeper with this one. I think we should change to use dill

https://github.com/uqfoundation/dill

instead of using pickle because dill is able to pickle (almost) any Python object whereas pickle is quite limited. Another thing to do for 2.4 :-)

Cheers,
Carlos

El 11/01/14 13:06, David Verelst escribió:

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


On 7 January 2014 17:22, Raymond Phillips <[email protected] <mailto:[email protected]>> wrote:

    Hi All,

    I'm pretty new to Spyder, having recently decided to migrate to it
    from MATLAB for my MSc research. I have a question regarding
    importing data.

    I'm aware of the interactive importing you can do in Spyder
    however, I was wandering if there is a line of code for importing
    a spydata file into the workspace as well. In MATLAB this would
    just be something like "load myData.mat"

    Thanks,

    Ray
-- 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:spyderlib%[email protected]>.
    To post to this group, send email to [email protected]
    <mailto:[email protected]>.
    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 [email protected].
To post to this group, send email to [email protected].
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to