Hangman: File I/O strings and lists python
<p>Writing a hangman program in python and I've come across a problem when passing in a file that has multi word strings and single word strings. </p>

<p>FILE:</p>

<p>hello brown fox</p>

<p>dog</p>

<p>cat</p>

<p>water</p>

<p>jump</p>

<pre><code>#initialize list
wordList = []
# get and open file
getFile = raw_input("Enter file name: ")
filename = open(getFile, "r")

def readWords(filename):
    for line in filename:
        # split any multi word line
        line.split()
        # add line to wordList
        wordList.append(line)
</code></pre>

<p>Yet the out put for wordList still reads:</p>

<pre><code>wordList = ['hello brown fox\n', 'dog\n', 'cat\n', 'water\n', 'jump\n']
</code></pre>

<p>I am trying to make it so that 'hello brown fox' appears as 3 separate strings.</p>
