python string to symbolic name
<p>I want to check imported names.<br>
Code: </p>

<pre><code>import fst # empty file fst.py
for s in dir(fst):
    print(s) # got string with symbolic names
</code></pre>

<p>Output: </p>

<pre><code>__builtins__
__cached__
__doc__
__file__
__name__
__package__
</code></pre>

<p>Now I want to check values of each defined name:<br>
Code:</p>

<pre><code>print(__builtins__)
print(__cached__)
print(__doc__)
print(__file__)
print(__name__)
print(__package__)
</code></pre>

<p>Question: How can I "extract" symbolic name from string?<br>
supposed code:</p>

<pre><code>import fst #empty file fst.py
for s in dir(fst):
    print(s, StrToSym(s)) # this call should be equal to str("__name__", __name__)
</code></pre>
