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