Any tutorial for Python PalmDB library?
Posted
by roddik
on Stack Overflow
See other posts from Stack Overflow
or by roddik
Published on 2009-11-09T10:33:10Z
Indexed on
2010/04/13
21:43 UTC
Read the original article
Hit count: 459
Hello, I've downloaded the Python PalmDB lib, but can't find any info on how to use it. I've tried reading docstrings and so far I've been able to come up with the following code:
from pprint import pprint
from PalmDB.PalmDatabase import PalmDatabase
pdb = PalmDatabase()
with open('testdb.pdb','rb') as data:
pdb.fromByteArray(data.read())
pprint(dir(pdb))
pprint(pdb.attributes)
print pdb.__doc__
#print pdb.records
print pdb.records[10].toXML()
which gives me the xml representation of a record (?) with some nasty long payload
attribute, which doesn't resemble any kind of human-readable text to me. I just want to read the contents of the pdb file. Is there a guide/tutorial for this library? What would you do to figure out the proper way to make things done in my situation?
© Stack Overflow or respective owner