python skipping lines?

Jussi Salmela tiedon_jano at hotmail.com
Mon Nov 27 14:14:30 EST 2006


lisa.engblom at gmail.com wrote:

> RawData = open('/Python25/working/data.txt', 'r')

You open this file only once. The first time in here:

> def PullHourlyData(filename, facility, unit):
>         for line in filename:

reads all of the file - nothing left for the other function calls!

A better way would be to read the file in once to a list and give that 
lkist to the function to process.

HTH,
Jussi



More information about the Python-list mailing list