赞
踩
import xlwt def write_xls_sheet(path, sheet_name, value): workbook = global_workbook sheet = workbook.add_sheet(sheet_name) for i in range(len(value)): for j in range(len(value[i])): sheet.write(i, j, value[i][j]) workbook.save(path) if __name__ == "__main__": global_workbook = xlwt.Workbook() write_xls_sheet("./data/test.xls", "a", [[1, 2, 3], [4, 5, 6]]) write_xls_sheet("./data/test.xls", "b", [["name", "age", ["weight", "high"]]])
猜你喜欢:
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/768639
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。