Hi, you have plenty of good responses. I thought I would add one more:
def data_iter(file_name):
data = file(file_name)
while True:
value = data.read(3)
if not value:
break
yield value
data.close()
With the above, you can grab the entire data set (3 characters at a
time) like so:
data_set = [ d for d in data_iter('data') ]
Or iterate over it:
for d in data_iter('data'):
# do stuff
Enjoy!
--
http://mail.python.org/mailman/listinfo/python-list
