[Tutor] would pickle or cpickle help?
john.ertl at fnmoc.navy.mil
Thu Jun 30 23:32:24 CEST 2005
I have a text file that contains several thousand lines of space delimited
text that contain a ship ID and a ship name. This file is updated every few
I have another file that contains the ship ID and some other info but not
the ship name. I have to append the ship name to the end of the line. Easy
I currently make a dictionary of the shipID(key) and ship name(value) and
use this to append the ship name to the end of the line that contains the
Could I use something like cpickle to store the dictionary once it is made
so I would not have to make it each time? I have never tried to use pickle
so I am bit fuzzy on what it can store and what it can't. Also would it
really buy me anything...it only takes a second or two to make the
dictionary? There is a chance the file that I use to make the dictionary
will eventually grow to be 10,000 lines or more.
Thanks for the ideas.
More information about the Tutor