Replacing words in a file
<p>It does work but it doesn't replace the letters.
First I open one file, and write the content to another. And then to the second file I replace some specific letters, but it doesn't work, An
any idea?
The code:</p>

<pre><code>def  copy_file():

    f=open("cartas.txt","r")
    g=open("copiar.txt","r+")
    g.writelines(f)
    f.close()

    for line in g:
       line = line.replace("s","ch")
       g.write(line) 
    g.close()

copy_file()
</code></pre>
