When a Python file is executed, each statement in the file is executed from top to bottom. In your case, there are six statements:
from ..
from ..
class MainPage ..
application = ..
def main() ..
if __name__ ..
Python , , , , , . , webapp run_wsgi_app.
MainPage. , , : a def. , def , . , .
webapp.WSGIApplication application.
main.
__name__. , Python, __name__. , , , Python, __name__ "__main__". if , : " - ?" , if.
if main(), run_wsgi_app, application.
WSGI, ", - URL-, URL- - , ". URL, "/" MainPage. - /URL, MainPage, .
, HTTP, /, GET, WSGI .get() MainPage. get , . , . WSGI -!
, WSGI URL. , , Python , .