Python load list from file and print random selection
<p>I have a file called <code>projects.txt</code> that contains the following line of code:  </p>

<pre><code>['Apollo', 'Astro', 'Aurora', 'Barcelona']
</code></pre>

<p>I use the following Python2 code to load the file and try to print a random selection but I'm always getting just a single character from my list:</p>

<pre><code>import random

projNames = open('projects.txt').read()
print(random.choice(projNames))
</code></pre>

<p><strong>Example Result:</strong> a</p>

<hr>

<p>However, if I copy the contents of the text file directly into the code, it works properly for me.</p>

<pre><code>import random

projNames = ['Apollo', 'Astro', 'Aurora', 'Barcelona']
print(random.choice(projNames))
</code></pre>

<p><strong>Example Result:</strong> Apollo</p>

<p>I need it to be able to load the contents of the file directly rather than editing the code in my <code>.py</code> file.</p>

<p>What did I overlook in my original code? I am specifically using Python 2.7.x <em>(latest version)</em>.</p>