Should I start a Python program with:
if__name__ == \'__main__\': some code...
And if so, why? I saw it many times but don\'t have a clue about
A better pattern is this:
def main(): ... if __name__ == '__main__': main()
This allows your code to be invoked by someone who imported it, while also making programs such as pychecker and pylint work.