I'm trying to convert a Real Basic routine into Python and I can't read the
long integer data from a file.
Here is the Real Basic code:
b=f.OpenAsBinar yFile
b.LittleEndian= True
i=b.ReadByte
titles=b.ReadLo ng
shows=b.ReadLon g
i=b.ReadLong
And here is my code:
db = open('otter.db' , 'rb')
null = db.read(1) # read empty byte
titles = db.read(4)
shows = db.read(4)
null = db.read(1) # read empty byte
print titles
When I print titles I get ascii pictures. How do I convert 'titles' to an
integer I can loop through?
Is db.read(4) correct for ReadLong?
Thanks!
PS. here's the file I'm working with http://otterprojectonline.info/otter.db
long integer data from a file.
Here is the Real Basic code:
b=f.OpenAsBinar yFile
b.LittleEndian= True
i=b.ReadByte
titles=b.ReadLo ng
shows=b.ReadLon g
i=b.ReadLong
And here is my code:
db = open('otter.db' , 'rb')
null = db.read(1) # read empty byte
titles = db.read(4)
shows = db.read(4)
null = db.read(1) # read empty byte
print titles
When I print titles I get ascii pictures. How do I convert 'titles' to an
integer I can loop through?
Is db.read(4) correct for ReadLong?
Thanks!
PS. here's the file I'm working with http://otterprojectonline.info/otter.db
Comment