Wondering what would be a good choice to store a binary data in file on a disk. Great if it would be a built-in Python module since I would like to keep it all stock. A random access to a written data could be a plus but it's not required. For this implementation I would rather go for a simplicity and speed. What I am looking for: save it now - get it later. Thanks in advance!
EDITED:
Found a problem why cPickle was erroring out. In one of the classes I have declared self.os=os And it appears self.os is not something cPickle likes... A bit later I found that cPickle doesn't accept PyQT objects if they (PyQT class instances) are given as a class's attributes (in case you dump a list of some_class instances).
An example below if run replicates the same error:
import cPickle
import os
class MyClass(object):
"""docstring for MyClass"""
def __init__(self, arg):
super(MyClass, self).__init__()
self.arg = arg
self.os=os
data=MyClass("Hello World")
file_name='dampData.data'
out_file = open(file_name, 'wb')
cPickle.dump(data, out_file)
out_file.close()