In python, how do I get the same behavior as when __name__ == '__main__':
<p>What is the best way to get this block of code to run when I import main.py rather than run it? </p>

<pre><code>#main.py
if __name__ == '__main__':
    #Do something interesting. 


#Do something to have the interesting code run after importing the file. 
import main.py
main.__main__() # wrong of course. 
</code></pre>
