Writing Error in program

kyosohma at gmail.com kyosohma at gmail.com
Tue Nov 20 22:16:15 CET 2007

On Nov 20, 3:02 pm, kou... at hotmail.com wrote:
> I have a code that writes to 2 seperate files.  I keep getting a "list
> index out of range" error.  The strange part is that when checking the
> files that I'm writing too, the script has already iterated through
> and finished writing, yet the error stated implies that it hasn't?  So
> how can it be, that my script has written to the files, yet the error
> is stating that it hasn't made it through the script?  I'll have 15
> files that I have written to and the script will bog out at number
> 10?  Is python doing something I'm not seeing?  I printed everything
> that was written on the shell and it shows that it went through the
> script, so how can it still say there are a few files left to iterate
> through?

Could you post some of the code and the traceback? It would be
especially good to see your list and make sure you're iterating
through it correctly. Do you open the file in the loop, write to it
and close it?

How can it write to 15 files and then quit at number 10? That
statement seems to contradict itself.

More details for the group would be great. Thanks!


More information about the Python-list mailing list