Hello World program in Python
The basic program while i was learning to program in python was displaying Hello World in web. And, this is how i did as,
from wsgiref.simple_server import make_server
def hello_world(envrion, start_response):
status = '200 OK'
headers = [('Content-type','text/plain')]
return ['Hello World']
httpd = make_server('',8010, hello_world)
print 'Serving on port 8010....'
i imported make_server from simple_server of wsgiref of python web module. After that, i define hello world function. This hello world function is called from make server and run for forever. Lastly, i browse from web http://localhost:8010, it display Hello world.