On 05/07/18 09:43, Abdur-Rahmaan Janhangeer wrote:
just when to use main() inif __name__ == '__main__' : main() is far is it good in py? or should file intended to be run just not include it?
It's a matter of taste. If your "file intended to be run" also contains things that might be useful as a module, use the "if __name__ == '__main__'" trick. Otherwise it can be more of a distraction than a help. I'm not a big fan of "main()" functions myself; creating a function which will be called exactly once seems rather wasteful.
-- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list
