Created
January 15, 2020 10:00
-
-
Save zxx/b381a23e3a97a6659538436e934e216c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 创建一个workbook 设置编码 | |
workbook = xlwt.Workbook(encoding='utf-8') | |
# 创建一个worksheet | |
worksheet = workbook.add_sheet('0') | |
worksheet.write(0, 0, label='词典名') # 第一行第一列 | |
worksheet.write(0, 1, label='词典标识') # 第一行第二列 | |
row = 1 | |
for d in dicts: | |
worksheet.write(row, 0, label=d['dict_name']) | |
worksheet.write(row, 1, label=d['dict_mark']) | |
row += 1 | |
workbook.save(get_dir() + '/' + '所有词典.xls') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment