Reading and writing files
<p>I am trying to read one text file and convert the contents of that file to pig latin on a new file. Here is what I have:</p>

<pre><code>def pl_line(word):
    statement = input('enter a string: ')

    words = statement.split()

    for word in words:
        if len(word) &lt;= 1:
            print(word + 'ay')
        else:
            print(word[1:] + word[0] + 'ay')


def pl_file(old_file, new_file):
    old_file = input('enter the file you want to read from: ')
    new_file = input('enter the file you would like to write to: ')

    write_to = open(new_file, 'w')
    read_from = open(old_file, 'r')

    lines = read_from.readlines()
    for line in lines():
        line = pl_line(line.strip('\n'))
        write_to.write(line + '\n')
    read_from.close()
    write_to.close()
</code></pre>

<p>However, when I run this, I get this error message:
TypeError: 'list' object is not callable</p>

<p>Any ideas of how to improve my code?</p>