Sunday, March 30, 2014

Print the attributes of an object in Python

This can be done easily using,

print object.__dict__

You can also write a function as below.

def dump_an_object(obj):
    for attr in dir(obj):

        print "obj.%s = %s" % (attr, getattr(obj, attr))

Monday, March 24, 2014

Getting rid of unicode pain in Python

Python programming has its quirks and one of them revolves around Unicode. This article provides a very useful explanation of the issues and ways to go around it.

http://nedbatchelder.com/text/unipain.html


Monday, March 3, 2014

REST API Guide

Here is a good guide to the REST API's.

http://rest.elkstein.org