Reference website: https://www.jianshu.com/p/fc97dd7e822c
Import xlwt # import modules workbook = xlwt.Workbook (encoding = ' UTF-. 8 ' ) # create workbook objects Worksheet = workbook.add_sheet ( ' Sheet1 ' ) # Create Worksheet Sheet worksheet.write (0, 0, ' Hello ' ) # write the content to the table, the first row of each parameter, the second column the parameter, the third parameter content workbook.save ( ' students.xls ' ) # save table students.xls
Import xlwt # import modules workbook = xlwt.Workbook (encoding = ' UTF-. 8 ' ) # create workbook objects Worksheet = workbook.add_sheet ( ' Test ' ) # Create Worksheet Sheet worksheet.write (0, 0, ' Hello ' ) # write the content to the table, the first row of each parameter, the second column the parameter, the third parameter content worksheet.write (0,. 1, ' 01 China ' ) worksheet.write ( . 1,. 1, ' 10 China ' ) worksheet.write ( . 1, 0, '' ) workbook.save (' C: \\ the Users del \\ \\ \\ students.xls Desktop ' ) # save table students.xls