Popular recipes by yoav glazner http://code.activestate.com/recipes/users/4178625/2011-10-24T22:26:07-07:00ActiveState Code RecipesBlocks for python (Python) 2011-10-24T22:26:07-07:00yoav glaznerhttp://code.activestate.com/recipes/users/4178625/http://code.activestate.com/recipes/577920-blocks-for-python/ <p style="color: grey"> Python recipe 577920 by <a href="/recipes/users/4178625/">yoav glazner</a> (<a href="/recipes/tags/block/">block</a>, <a href="/recipes/tags/lambda/">lambda</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/style/">style</a>). </p> <p>A simple <strong>block</strong> function that lets one send multi line blocks of code to a function it doesn't really act like a <em>normal</em> def/lambda but offers cool style</p> entry_point decorator - no more if __name__ == '__main__' (Python) 2011-07-14T20:42:35-07:00yoav glaznerhttp://code.activestate.com/recipes/users/4178625/http://code.activestate.com/recipes/577791-entry_point-decorator-no-more-if-__name__-__main__/ <p style="color: grey"> Python recipe 577791 by <a href="/recipes/users/4178625/">yoav glazner</a> (<a href="/recipes/tags/main/">main</a>, <a href="/recipes/tags/python/">python</a>). Revision 2. </p> <p>Use this decorator to remove the UGLY "if __name__ == '__main__':"</p>