Tuesday, 22 August 2017

Flow of execution in Python

I'm completely new to Python and thus a bit confused about the flow of a program in Python.
If my understanding is correct, for a single .py file, if we add the line



if __name__ =="__main__": main()


The interpreter finds the main function and starts executing from there.

This, since Python execution goes sequentially line after line.



My question is if there are multiple .py files and 1 such file has the main function, like Java/C++ is there a way the python interpreter can know ad start executing the main function?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...