Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import os
  2. import csv
  3. import xlrd
  4. import xlwt
  5.  
  6. with xlrd.open_workbook('Pilvetyybid_1968_Jõgeva.xls') as wb:
  7. sh = wb.sheet_by_index(0) # or wb.sheet_by_name('name_of_the_sheet_here')
  8. with open('a_file.csv', 'wb') as f:
  9. c = csv.writer(f)
  10. for col in range(sh.ncols):
  11. if col ==0 or col>10:
  12. pass
  13. else:
  14. for row in range(sh.nrows):
  15. if row == 0:
  16. pass
  17. else:
  18. c.writerow(sh.row_values(row))
  19.  
  20. c.writerow(sh.row_values(row))
  21. TypeError: a bytes-like object is required, not 'str'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement