import xlwt
#先创建excel
style = xlwt.XFStyle()
style.alignment.wrap = 1 #设置自动换行
workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet('My Worksheet')
#改变行高或者列宽 xlwt中是行和列都是从0开始计算的
first_col = worksheet.col(9)
two_col = worksheet.col(1)
three_col = worksheet.col(2)
# sec_col = worksheet.col(0)
first_col.width = 720*20
two_col.width = 320*20
three_col.width = 320*20
#保存excel
head = ['username', 'email', 'job_title', 'phone', 'company_name', 'status', 'country', 'city', 'Registration_time', 'profile', 'logo_address']
for index, value in enumerate(head):
worksheet.write(0, index, value, style)
content = [[u'1231', u'123@123.com', u'12312', u