<blockquote>
<p><strong>Possible Duplicate:</strong><br/>
<a href="https://stackoverflow.com/questions/1373164/how-do-i-do-variable-variables-in-python">How do I do variable variables in Python?</a> </p>
</blockquote>
<p>我有一个分配了字符串的变量,我想基于该字符串定义一个新变量。</p>
<pre><code>foo = "bar"
foo = "something else"
# What I actually want is:
bar = "something else"
</code></pre>