[Tutor] Problem with logic while extracting data from binary file
bryan.fodness at gmail.com
Thu Mar 27 22:42:34 CET 2008
I can't seem to keep track of my start values when I break up the value
variable into svalues. Do you think I should do this, or should I have a
running count from the beginning of the file and keep track until the end?
I am trying to find \n0\x82\x00 and \n0\x84\x00 within the block. I've
added the if statement, and it seems to enter the parseSequence function the
way I would expect, but it does not seem to populate the dictionary.
Sorry for so many questions about this, but I feel like I am so close.
while next < len(data):
for element, next, value, length in parseDataElement(data, next):
## if element in ('\n0\x10\x00', '\n0@\x00', '\n0p\x00',
## '\n0\xb0\x00', '\n0\x80\x01'):
if element == '\n0p\x00':
start = 0
while start < length:
element, start, svalue = parseSequence(value, start)
start_2 = 0
element, start_2, svalue = parseSequence(svalue,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor