How To Close Main Function In Python Code