"Karim Ali" wrote:
> Hi,
>
> Simple question. Is it possible in python to write code of the type:
>
> -
> while not eof <- really want the EOF and not just an empty line!
readline() reads to the next newline - an empty line *is* EOF -
a blank line has at least a
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>If you open the file in binary mode, you can easily keep track of the
>position in file:
>
>bytepos = 0
>with file(filename) as f:
> for line in f:
> ... process line ...
> bytepos += len(line)
>
>If you need to restart the operation, simply seek
"Karim Ali" <[EMAIL PROTECTED]> writes:
> -
> while not eof <- really want the EOF and not just an empty line!
> readline by line
> end while;
> -
for line in open_file:
...
It will stop on EOF, not on empty line.
> But also, in cas
Karim Ali wrote:
> Hi,
>
> Simple question. Is it possible in python to write code of the type:
>
> -
> while not eof <- really want the EOF and not just an empty line!
> readline by line
> end while;
> -
>
> What I am using now is the im
In <[EMAIL PROTECTED]>, Karim Ali
wrote:
> Simple question. Is it possible in python to write code of the type:
>
> -
> while not eof <- really want the EOF and not just an empty line!
> readline by line
> end while;
> -
while True: