What does this mean exit (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 main().

A simplified example where this might be used:

def main():
    try:
        doSomething()
        return 0
    except:
        return 1


if __name__ == "__main__":
    exit (main())

If an explicit return value is not given in main(), the default value of None will be returned. This produces the same system return code as explicitly specifying return 0. If main returns anything other than an integer or None a system return code of 1 will be produced.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)