I have seen this in a couple of python script I have been reading lately. I have looked at the doc; they only give examples deal with passing a termination value or string of some sort.
I think what this does is call the main method, then exit?
If someone could shed some light on this I would appreciate it.
if __name__ == "__main__":
This will call the function
main() and when main finishes, it will exit giving the system the return code that is the result of
A simplified example where this might be used:
def main(): Try: doSomething() return 0 Except: return 1 if __name__ == "__main__": exit (main())