Iteration with a variable in Python 2.7
<p>Hi experts I'm looking to make a loop of reading a text file then output (8) text files with the following code:</p>

<pre><code>for i in range(1,9):
    with open(inputgui, 'r') as input1:
        junkinfo = [next(input1) for dummy in range(22)]
        with open(output, 'w') as output1:
            for line in input1:
                columns = line.strip().split()
                output1.write('{:8}{:8}\n'.format(columns[1], columns[i+1]))
</code></pre>

<p>Note that variable <code>inputgui</code> is a text variable from a user and output is a text variable from a user.  Example, the user in the gui will select <code>'C:/Data.txt'</code> and will want to name the output and iterate 8 times to produce <code>'C:/NewData1.txt'</code>, <code>'C:/NewData2.txt'</code>, etc.  How do I format variable <code>output</code> to iterate or most efficient way?</p>
