for x in options.__dict__.iteritems(): section = x[0] boolean = x[1] print section, boolean if boolean == "True": print section, boolean