Shiva Wrote in message:
> OK,
> Hi Dave,
>
> I modified it as below and it works(If there is a way to make this more
> efficient please let me know)
>
Deends on what you mean by efficiency.
The big memory efficiency gain was when you got rid of either the
read or readlines.
Performance
OK,
Hi Dave,
I modified it as below and it works(If there is a way to make this more
efficient please let me know)
By the way I am using Python 3.4
import sys
import re
def extract_names(filename):
path = '/home/LearnPython/exercises/'
fullfilename = path+filename
print('fullfilenam
Hi,
I am doing a regular expression search for a year through a file.
fileextract = open(fullfilename,'r')
line = fileextract.read()
texts = re.search(r'1\d\d\d', line)
print(texts.group())
The above works.
However if I do:
fileextract = open(fullfilename,'r')
line = fileextra