Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

variable output file names

$
0
0
I am running a while loop and would like to name each output file using the iterator (i) as part of the file name. I have tried "fac" + i, "fac" + str(i), fac + str(i), and fac + i. None of these work.

Does anyone know how this can be done?

Code:

>>> while i < 111101:
...    i = 1111
...    fac + i = ExtractByAttributes("Fac", "Value =" + i)
...    i = i + 1111
...   
Runtime error SyntaxError: can't assign to operator (<string>, line 3)


Viewing all articles
Browse latest Browse all 2485

Trending Articles