> I'm trying to get only the lines that start with
> "This" for a text file.
>
> Here's what I wrote:
>
> >>> import re
> >>> f = open('c:/lines.txt').readlines()
> >>> for line in f:
> match = re.search('^This',f)
> if line == match:
> print match
try
if line.startwith('This'):
its easi
H Ron,
>>> import re
>>> f = open('c:/lines.txt').readlines()
>>> for line in f:
match = re.search('^This',f)
if line == match:
print match
Hi Ron,
Welcome to the wonderful world of Python.
from re.search.__doc__ ;
"Scan through string looking for a match to the
Can anyone tell me what I've done wrong in this
script.
I'm trying to get only the lines that start with
"This" for a text file.
Here's what I wrote:
>>> import re
>>> f = open('c:/lines.txt').readlines()
>>> for line in f:
match = re.search('^This',f)
if line == match: