incrementing array corresponding with a sorting time
<p>I want to create a table with a specific array increments corresponding to that specific time. for example:</p>

<pre><code>n     sec
100    0.2
200    0.4
etc.. 
</code></pre>

<p>Y is number of tries of specific array, n is the array size, increment is specific increment</p>

<pre><code>if sortfunction==1:
            i=0
            while i&lt;y:
                dt=0
                for i in range(n):
                    i=i+increment
                    dt+=sort_timehelp(x,quick_sort)
                    output="%d %f\n" %(i,dt)
                    print output
</code></pre>

<p>for example if i put N as 1000 and increment 100, then it would look something like an above table.</p>

<p>right now i get:</p>

<pre><code>n    sec
100  0.001
101  0.0012
102  0.0014
</code></pre>

<p>etc it goes by 1 not by the increment size</p>

<p>EDIT:
I got another question: why this does this while loop doesn't go more times?</p>

<pre><code>   i=0
   while i&lt;y:
        i=i+1
        dt=0
        for i in xrange(increment, n+increment, increment):
                dt+=sort_timehelp(x, quick_sort)
                output="%d %f\n" %(i,dt)
                print output
</code></pre>

<p>i is the number of array tests.
Why it doesn't go for example 2 times</p>

<p>Edit: Never mind I used for loop instead.
I have a last question.
What if I have a lot of those kinds of if statements only the difference is a sortfunction, then how can i save it all of that stuff to a file, since when I tried it will only save a last printed statement</p>

<pre><code>#
 saving=input("You want to save data ? type 0 to continue or 1 to save " )
 if saving == 0:
        continue
 if saving == 1:
        ask=raw_input("Type the name file: ")
        fileout=open(ask+".csv","a")
        fileout.write(output)
        fileout.close()
</code></pre>

<p>the indentation of "saving" is the same as if sortfunction</p>
