Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Code help for understand

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


shahviral.it at gmail

May 2, 2012, 5:30 AM

Post #1 of 2 (131 views)
Permalink
Code help for understand

Hi

in every .py file I found this same code line on the below side

*def main():
application = webapp.WSGIApplication([('/', MainHandler)],
debug=True)
run_wsgi_app(application)


if __name__ == '__main__':
main()
*
can anyone explain me what's the all this thing suggest?


jmwebaze at gmail

May 2, 2012, 5:43 AM

Post #2 of 2 (118 views)
Permalink
Re: Code help for understand [In reply to]

if you are referring to the line
*
*
*if __name__ == '__main__':*
*
*
Find a good explanation here
*
*
http://stackoverflow.com/questions/419163/what-does-if-name-main-do



On Wed, May 2, 2012 at 2:30 PM, viral shah <shahviral.it [at] gmail> wrote:

> Hi
>
> in every .py file I found this same code line on the below side
>
> *def main():
> application = webapp.WSGIApplication([('/', MainHandler)],
> debug=True)
> run_wsgi_app(application)
>
>
> if __name__ == '__main__':
> main()
> *
> can anyone explain me what's the all this thing suggest?
>
>
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


--
*Mob UG: +256 (0) 70 1735800 | NL +31 (0) 6 852 841 38 | Gtalk: jmwebaze |
skype: mwebazej | URL: www.astro.rug.nl/~jmwebaze

/* Life runs on code */*

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.