Hi
On 06/11/2007, Chris G cl@isbd.net wrote:
Are there any Python people here?
Not me. Without semi-colons at the end of the line, it just reminds me of the time I used to program in VB. Yuck!
How do I do the equivalent of the C below in Python :-
while ( (str = read(file)) != NULL)
Which read() is that??
I can read the data OK, i.e. I have opened the file and I can successfully read from the file with the line:-
tagNum = tlvFile.read(3)
but I don't see how to make that part of a for/while loop that exits at the end of the file. I can't use an iterator because the file is read in variable length chunks whose length depends on context.
Have you Google-searched for "python EOF file"? Generally there will be some way to know if EOF has been reached. If there's no support, ditch the language ;)
Good luck
Srdjan