string.find does not work in file

Wolfram Strauß str at iis.fhg.de
Tue Jun 17 05:06:32 EDT 2003


Hi,
I have a problem to run the following lines in a file.
>
import string
f = open('in.txt')
for l in f.readlines():
	print string.find(l, '"\n')
<

In my python shell (version 2.2.2) on a W2000 system the code finds all 
lines with the pattern. But running the same code as a python scipt in a 
shell it does not find any pattern.

If you have any idea, please let me know. Thanks Wolfram

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/




More information about the Python-list mailing list