where does the python start the code execution from? -




i trying understand when execute .py file, part of code python start execution from? e.g.when execute java program, "public static void main(string[] args)" location java start code execution. so, when talk python, how work? know there python main function

(__name__ = "__main__")  

, have gone through article in , out of stackoverflow, loads python module, , python udfs etc. so, per understanding, location executed first thing. please correct me, or guide me web links query.

if python code in method, no code executed unless explicitly call method (e.g. after checking __name__ == '__main__'). convention call main method, can call method starting point of execution.

if python code not in method, code executed anytime run or import file.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -