Slashdot Mirror


User: adonisv1

adonisv1's activity in the archive.

Stories
0
Comments
3
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 3

  1. Re:Fast as C but uses lots more memory on Firefox Gets Massive JavaScript Performance Boost · · Score: 2, Informative

    You can look at Psyco which functions like a JIT for Python.

  2. Re:IC what? on ICQ Starts Blocking Alternative Clients · · Score: 1

    6 digits starts at 184XXX

  3. Re:Python comes with SQLite (What about cPickle?) on F/OSS Flat-File Database? · · Score: 2, Informative

    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()