Problem with REGEX in Python

Tom Verbeure tom_verbeure at hot.nospam.mail.com
Fri May 30 17:48:19 EDT 2003


> > > p = re.compile('.*[pP][ython].*')
> > > f=file("aufgabe14.test")
> **Here f is a filepointer**
>
> > > for currentline in f:
> **So this code can't work, because you can't iterate over a filepointer

Actually, It *does* work for recent Python versions.
Tom






More information about the Python-list mailing list