Thanks for taking a look at this David.

I will try do something similar using the script that you provided.

I'll keep an eye out for any integrated support that Spyder may have for 
this in the future.

Thanks again,

Ray

On Saturday, 11 January 2014 20:06:28 UTC+2, David wrote:
>
> 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'): 
> withopen(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 <raymo...@gmail.com<javascript:>> 
> 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 spyderlib+...@googlegroups.com <javascript:>.
>> To post to this group, send email to spyd...@googlegroups.com<javascript:>
>> .
>> 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+unsubscr...@googlegroups.com.
To post to this group, send email to spyderlib@googlegroups.com.
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