 <p>You can use <a href="http://docs.python.org/2/library/ast.html#ast.literal_eval" rel="nofollow"><code>ast.literal_eval</code></a>:</p> <pre><code>&gt;&gt;&gt; from ast import literal_eval &gt;&gt;&gt; mystr = '[[1, 2, 3], [4, 5, 6]]' &gt;&gt;&gt; x = literal_eval(mystr) &gt;&gt;&gt; x [[1, 2, 3], [4, 5, 6]] &gt;&gt;&gt; type(x) &lt;type 'list'&gt; &gt;&gt;&gt; </code></pre>