how to copy list of files into another file?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1001538/how-do-i-concatenate-files-in-python">How do I concatenate files in Python?</a>  </p>
</blockquote>



<pre><code>def copy_file(file_name,copy_file_name,copies):
    i=0
    a=open(file_name,'r')
    f=open(copy_file_name,'w')
    for line in a:
        while i&lt;copies:
            f.write(line)
            i+=1
    a.close()
    f.close()
    return 
copy_file("D:\student\example2.txt","D:\student\copy_file_name.txt",3)
</code></pre>

<p>i need to copy a text file 3 times to another file and the loop stops after the first line:(</p>

<pre><code>def merge_file(list,file_name):
    for i in range(len(list)):
        a=open(list[i],'r')
        f=open(file_name,'w')
        f.write(list[i])
    f.close
    a.close
    return
merge_file([("D:\student\example2.txt"),("D:\student\example3.txt")],"D:\student\copy_file_name.txt")
</code></pre>

<p>i need to copy list of files into one file.</p>
