How to convert a string to a list in python for a range(1,10)
<p>In python there is a method called <code>range()</code> which defines a list, for example:</p>

<pre><code>&gt;&gt;&gt; a = range(1,10)
&gt;&gt;&gt; a
[1, 2, 3, 4, 5, 6, 7, 8, 9]
&gt;&gt;&gt; type(a)
&lt;type 'list'&gt;
</code></pre>

<p>I have a configuration file like this:</p>

<pre><code>[ports]
scan_range = 1,10
</code></pre>

<p>Output: </p>

<pre><code>1,10
&lt;type 'str'&gt;
</code></pre>

<p>I want read this configuration file and use this to generate the arguments for the range() method - how do I do this ?</p>