cpickle

How do I fix this unicode/cPickle error in Python?

ids = cPickle.loads(gem.value) loads() argument 1 must be string, not unicode ...

cPickle ImportError: No module named multiarray

Hello, I'm using cPickle to save my Database into file. The code looks like that: def Save_DataBase(): import cPickle from scipy import * from numpy import * a=Results.VersionName #filename='D:/results/'+a[a.find('/')+1:-a.find('/')-2]+Results.AssType[:3]+str(random.randint(0,100))+Results.Distribution+".lft" filename='D:/results/pppp...

Help with cPickle in Python 2.6

I tried the following code I python. This is my first attempt at pickling. import Tkinter import cPickle root = Tkinter.Tk() root.sclX = Tkinter.Scale(root, from_=0, to=1500, orient='horizontal', resolution=1) root.sclX.pack(ipadx=75) root.resizable(False,False) root.title('Scale') with open('myconfig.pk', 'wb') as f: cPick...

Need help making a program remember settings, cPickle

How do I make this code remember the last position of the scale, upon reopening? import Tkinter import cPickle root = Tkinter.Tk() root.sclX = Tkinter.Scale(root, from_=0, to=1500, orient='horizontal', resolution=1) root.sclX.pack(ipadx=75) root.resizable(False,False) root.title('Scale') with open('myconfig.pk', 'wb') as f: ...

Why do I get the following error while trying to use cPickle?

The Error: Traceback (most recent call last): File "<string>", line 244, in run_nodebug File "C:\Python26\pickleexample.py", line 13, in <module> place = cPickle.load(f) cPickle.UnpicklingError: NEWOBJ class argument has NULL tp_new My Code: import Tkinter import cPickle root = Tkinter.Tk() place = 0 root.place = Tkinter.IntVar() ro...

How do I store then retrieve Python-native data structures into and from a file?

I am reading an XML file and reorganizing the desired data into Python data structures (lists, tuples, etc.) For example, one of my XML parser modules produces the following data: # data_miner.py animals = ['Chicken', 'Sheep', 'Cattle', 'Horse'] population = [150, 200, 50, 30] Then I have a plotter module that roughly says, e.g.: # ...

Does linux disk buffer cache make python cPickle more efficient than shelve?

Is IO more efficient, due to the linux disk buffer cache, when storing frequently accessed python objects as separate cPickle files instead of storing all objects in one large shelf? Does the disk buffer cache operate differently in these two scenarios with respect to efficiency? There may be thousands of large files (generally around...