python stacking lines in terminal
<p>Python does not continue to replace the same line in the terminal, but it replaces "name" and adds the progress bar to a new line which results in a huge stack of progress bars...this only happens when I use "\n" before "name". How can I get the result to look like this?</p>

<pre><code>[###                                                               ] 4%
name2
</code></pre>

<p>python</p>

<pre><code>mylist = ['name1', 'name2', 'name3',...'name66']

for name in mylist:
  sys.stdout.write('\r[%-66s] %d%%' % ('#'*prog, (prog*1.51515151515))+'\n'+name)
  sys.stdout.flush()
</code></pre>
