string.find does not work in file

Erik Max Francis max at alcyone.com
Tue Jun 17 06:13:00 EDT 2003


Roman Suzi wrote:

> Maybe the problem is that there are really no \n right after '"'.
> For example, the text file uses CRLF line endings.
> Try to find '"\r\n'

That's pretty much precisely wrong, since Python, like C, will in text
mode (the default) translate the local end-of-line sequence to a
newline.

The reason the original poster's code doesn't work is for some other
reason, probably that the test file he's using (which he didn't show
here) doesn't contain what he thinks it does.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ The doors of Heaven and Hell are adjacent and identical.
\__/  Nikos Kazantzakis




More information about the Python-list mailing list