shutdown={"yunfeiyang":{"username":"yunfeiyang","binding_house":{0:"1",1:"2"},"register_time":"2018-20"}}
import csv
csvfile = file('csvtest.csv', 'wb')
writer = csv.writer(csvfile)
writer.writerow(['username','binding_hourse','register_time'])
list1=[]
for i in shutdown.values():
s=tuple(list(i.values()))
list1.append(s)
writer.writerows(list1)