Friday, 28 February 2014

Get the Content-Type of an URL

Hey everybody, Have you ever tried to get the content type of any website via python, If not try like this. I tried on python terminal. OR >>> import urllib >>> res = urllib.urlopen("https://www.wslb2b.ford.com/login.cgi") >>> http_message = res.info() >>>...

Tuesday, 25 February 2014

Sunday, 23 February 2014

Python Regex Expression(Regex!!)

Introduction Matching text patterns Support Python module supports re module for regex support Visit Of Regex Search expression Python regular expression can be written as match = re.search(pattern, string) Search pattern takes following parameters a) pattern:...

Tuesday, 18 February 2014

Gotchas about __str__ and __repr__

Many of python developers confused with the gotcha of __str__ and __repr__ in-built function of python. So lets's try to clear this. For new beginners __str__ can be treated as informal string representation of an object. __repr__ can be taken as formal representation of...