[Tutor] file.read..... Abort Problem

Tomas Markus tomas.markus at gmail.com
Thu Oct 20 21:10:53 CEST 2005


Hello Pythoners,

This is probably a very newbie question (after all I am one):

I am trying to read a file with some 2500 lines and to do a scan for "not
allowed" characters in there (such as accented ones and so on). The problem
is that the file I am testing with has got one of those somewhere on line
2100 (the hex value of the character is 1a) and all of the
file.readfunctions (read, readline, readlines) actually stop reading
the file exactly
at that line as if it was interpreted as an EOF. Can you, please, help? Btw:
When I am past this problem I will be asking yet another question: what is
the most effective way to check a file for not allowed characters or how to
check it for allowed only characters (which might be i.e. ASCII only).

Many, many thanks.

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051020/5f149d44/attachment.html


More information about the Tutor mailing list