It isn't an absolute requirement but usually it is best to split your scripts into functions and use the __main__ entry for the script