473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1351
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sh | last post by:
Hi guys, Well, I have a (maybe dumb) question. I want to write my own little blog using Python (as a fairly small but doable project for myself to learn more deaply Python in a web context). ...
5
by: Alex Polite | last post by:
I need to put recursive data structures on disc and found out that cPickle doesn't like recursion. What are my options? alex -- Alex Polite http://polite.se
5
by: Marcus Lowland | last post by:
Hello, I'm fairly new to python and have read about and wanted to begin experimenting with cpickle. As I understand, this should be a native module in the python library. I have python 2.3 and now...
0
by: David Bear | last post by:
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,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.