469,643 Members | 1,233 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

stringified cPickle

I'm rather new to pickling but I have some dictionaries and lists I want to
package and send to another process (on another machine).

I was hoping I could just send a stringified pickle. However, the examples
in the doc have:
import pickle
pickle.dump(obj,open('save.p','w'))


I don't really want to write to a file. I know I could write to sys.stdout.
But I'd rather collect the string and do some garbage collect, etc before I
exit the script.

Is there a way to have cPickle just hand me a string?

--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
Nov 22 '05 #1
2 1246
On 11/17/05, David Bear <da********@asu.edu> wrote:
I'm rather new to pickling but I have some dictionaries and lists I want to
package and send to another process (on another machine).

I was hoping I could just send a stringified pickle. However, the examples
in the doc have:
import pickle
pickle.dump(obj,open('save.p','w'))


I don't really want to write to a file. I know I could write to sys.stdout.
But I'd rather collect the string and do some garbage collect, etc beforeI
exit the script.

Is there a way to have cPickle just hand me a string?

--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
--
http://mail.python.org/mailman/listinfo/python-list


pickle.dumps
Nov 22 '05 #2
On 11/17/05, David Bear <da********@asu.edu> wrote:
I'm rather new to pickling but I have some dictionaries and lists I want to
package and send to another process (on another machine).

I was hoping I could just send a stringified pickle. However, the examples
in the doc have:
import pickle
pickle.dump(obj,open('save.p','w'))


I don't really want to write to a file. I know I could write to sys.stdout.
But I'd rather collect the string and do some garbage collect, etc beforeI
exit the script.

Is there a way to have cPickle just hand me a string?

--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
--
http://mail.python.org/mailman/listinfo/python-list


pickle.dumps
Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.