python skipping lines?

lisa.engblom at gmail.com lisa.engblom at gmail.com
Mon Nov 27 19:17:57 CET 2006


Hi,

I've just started programming in python, and have run into an
unexpected problem.  I am using python to pull text data from some csv
files.  I have one file that has the important identifiers (name, etc)
and other files with lots of other data.  I wrote a function that takes
the file name and identifiers as inputs, selects the data I need, and
outputs it to another file.  This function (PullData) seems to work
fine.

In the same .py file, but separate from the function, I entered used
"for line in file" to step through each line in my identifier file and
feed the identifiers into my PullData function.  It works fine for the
first entry in my identifier file, but it will not call the function
again.  It will execute lines before or after the appropriate number of
times given the number of lines in the identifier file.  i just put in
a dummy counter variable to try to figure out why it wasn't working)
... but it always skips the function call after the first line.

Any ideas of what could be the problem?




More information about the Python-list mailing list