I don't think this really matters and by convention in most Python code the main() function is last.  This falls out of the `if __name__ == '__main__'` pattern being most useful when it is last.