<p>How do I convert a string to the variable name in <a href="http://en.wikipedia.org/wiki/Python_%28programming_language%29" rel="noreferrer">Python</a>?</p>

<p>For example, if the program contains a object named <code>self.post</code> that contains a variable named, I want to do something like:</p>

<pre><code>somefunction("self.post.id") = |Value of self.post.id|
</code></pre>

As referenced in Stack Overflow question
Inplace substitution from ConfigParser
, you're looking for
```
eval()
```
:
```
```
print eval('self.post.id') # Prints the value of self.post.id
```
```