← Back to Users
adonisv1's activity in the archive.
You can look at Psyco which functions like a JIT for Python.
6 digits starts at 184XXX
Why not the pickle/cPickle module? Not a flat-file but easier to manipulate since your just serializing native Python objects. e.g. import cPickle class Record: def __init__(self, fname, lname, email): self.fname = fname self.lname = lname self.email = email # --- # Write out the data records = list() records.append(Record("John", "Doe", "jd@email.com")) output = open("records.db", "wb") cPickle.dump(records, output) output.close() # --- # Read back the data inputFile = open("records.db", "rb") data = cPickle.load(inputFile) for record in data: print record.fname, record.lname, record.email inputFile.close()
You can look at Psyco which functions like a JIT for Python.
6 digits starts at 184XXX
Why not the pickle/cPickle module? Not a flat-file but easier to manipulate since your just serializing native Python objects.
e.g.
import cPickle
class Record:
def __init__(self, fname, lname, email):
self.fname = fname
self.lname = lname
self.email = email
# ---
# Write out the data
records = list()
records.append(Record("John", "Doe", "jd@email.com"))
output = open("records.db", "wb")
cPickle.dump(records, output)
output.close()
# ---
# Read back the data
inputFile = open("records.db", "rb")
data = cPickle.load(inputFile)
for record in data:
print record.fname, record.lname, record.email
inputFile.close()