Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import csv
- import xlrd
- import xlwt
- with xlrd.open_workbook('Pilvetyybid_1968_Jõgeva.xls') as wb:
- sh = wb.sheet_by_index(0) # or wb.sheet_by_name('name_of_the_sheet_here')
- with open('a_file.csv', 'wb') as f:
- c = csv.writer(f)
- for col in range(sh.ncols):
- if col ==0 or col>10:
- pass
- else:
- for row in range(sh.nrows):
- if row == 0:
- pass
- else:
- c.writerow(sh.row_values(row))
- c.writerow(sh.row_values(row))
- TypeError: a bytes-like object is required, not 'str'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement