Bala's Blog

JOY OF PROGRAMMING

Month: January, 2012

How to get Http Response using Python – 1

Today I am starting new series of posts for python and interesting things that can be done with it.

The following code can be used to hit the url and print the response in python

#You can use the Python standard libraries urllib, urllib2 or httplib to make HTTP requests

import urllib2

#the method urlopen hits the url specified and read method returns the response

response = urllib2.urlopen(‘http://www.facebook.com’).read()

print response

Thanks

J.K.B.S

Advertisements

Supervisord utility – 1

The supervisord utility is very much useful for starting , restarting and stopping the process even from remote machines without given the access previlages to the machine.

The supervisord can be installed by using the following steps in the Installation of Supervisord

This can be done when we have python installed in our machine.

 

 

More on this will be on the upcoming posts…