Last Updated: February 25, 2016
· alexanderbrevig

Make your Python code module safe

Here is a boiler-plate that I use with Python:

This enables 'clients' of your code to include your script/module without executing it.

If you use Sublime Text 2 I recommend the Gist package, which enable you to pull gists with ease. Version controlled snippets are awesome!


import sys

def main():
    print 'Hello there', sys.argv[1]

if __name__ == '__main__':

I think I found it on google somewhere.