On Mon, 24 Aug 2009, Flavio Coelho wrote:

>
> That's not what I meant,
>
> I will share the whole notebook, and the pickled files should be
> loaded from the same notebook in which they are generated. But I would
> like the cPickle.load command did not depend on a hard-coded url.
>
> The reason they are being dumped is to free-up memory for the rest of
> the calcuations, and then the the data is reloaded bit-by-bit to
> create plots.

Sorry, I completely didn't understand your context. Sounds like what you 
want is the DATA variable, which is a (constant) directory to store any 
data associated with a worksheet.

- Robert

> On 24 ago, 18:59, Robert Bradshaw <rober...@math.washington.edu>
> wrote:
>> On Mon, 24 Aug 2009, Flavio Coelho wrote:
>>
>>> Hi,
>>
>>> I am porting a python script to a notebook and in my script I save
>>> some data as pickles which  are loaded later for further processing.
>>
>>> I noticed that when I dump the pickles on a cell, I get a link to the
>>> dumped pickle which looks like this:
>>> http://localhost:8000/home/admin/5/cells/12/week_0
>>
>>> How do I "cPickle.load" the file now?It is available through sage's
>>> web server, so I have tried urllib2.urlopen('http://localhost:8000/
>>> home/admin/5/cells/12/week_0')
>>> but then I get an unpickling error:
>>> cPickle.UnpicklingError: invalid load key, '<'.
>>
>>> Also, one of the reasons I am porting this script to Sage is to be
>>> able to share it with others, and I would like to find a way to link
>>> to a dumped pickle which was not hard-linked to a cell number so that
>>> users could modify the script and not have to worry about where the
>>> pickles ended up.
>>
>>> thanks in advance,
>>
>>> Flávio
>>
>> What you can do is download the file and put it up on any webserver you
>> want, giving out the corresponding url.
>>
>> - Robert
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to