Retrieving a partial pickle

Z

Zac Burns

I have a large pickle file, which happens to be a list with lots of
objects in it.

What sort of things can I do without unpickling the whole object?

I would particularly like to retrieve one of the elements in the list
without unpicking the whole object.

If the answer is not specific to lists that would be useful (works on
getting items in a dictionary, or doing introspection on the objects
or whatever)

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games
 
P

Paul Rubin

Zac Burns said:
I have a large pickle file, which happens to be a list with lots of
objects in it.
What sort of things can I do without unpickling the whole object?

If it's for some kind of data recovery of a busted file, you could
code some awful hack to pull stuff out of the middle of the pickle,
but that's not the idea. You may want the shelve module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top