<div dir="ltr"><div>Hi Everyone,</div>
<div>&nbsp;</div>
<div>I am trying to read a comma-delimitted list (&quot;aaa&quot;,&quot;bbb&quot;,&quot;ccc&quot;) from a text file and assign those values to a list, x, such that:</div>
<div>&nbsp;</div>
<div>x&nbsp;= [&quot;aaa&quot;, &quot;bbb&quot;, &quot;ccc&quot;]</div>
<div>&nbsp;</div>
<div>The code that I have come up with looks like this:</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; x = []<br>&gt;&gt;&gt; f = open(r&#39;c:\test.txt&#39;, &#39;r&#39;)<br>&gt;&gt;&gt; x.extend(f.readlines())<br>&gt;&gt;&gt; x<br>[&#39;&quot;aaa&quot;,&quot;bbb&quot;,&quot;ccc&quot;&#39;]</div>
<div>&nbsp;</div>
<div>If you look closely, there is an extra pair of single quotes (&#39;) that encapsulates the string.&nbsp; Therefore, len(x) returns 1, instead of 3.&nbsp; Is there a function to &quot;separate&quot; this list out?&nbsp; I hope my question makes sense.</div>

<div>&nbsp;</div>
<div>Thanks in advance.</div>
<div>&nbsp;</div>
<div>Samir</div>
<div>&nbsp;</div>
<div>&nbsp;</div></div>