about main()

Joel Goldstick joel.goldstick at gmail.com
Thu Jul 5 07:55:05 EDT 2018


On Thu, Jul 5, 2018 at 7:45 AM, Abdur-Rahmaan Janhangeer
<arj.python at gmail.com> wrote:
> performance?

You are asking basic file layout questions in the learning process of
understand how to code in python.  Performance should be very low on
your list of concerns.  The only thing that happens when the file is
loaded is that it gets compiled, and run.  If it is imported, and you
have the 'if __name__ ... block, it will run the code within the if
block.  If that has a main() function it makes it simpler later to
change what main does instead of cluttering up the if block.  But
there is no 'performance' issue that I can see.
>
> Abdur-Rahmaan Janhangeer
> https://github.com/Abdur-rahmaanJ
>
> * Create as many functions as you can
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays



More information about the Python-list mailing list