Updated Python main function template