Guest User

Untitled

a guest
Jun 20th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import xlrd
  2. import csv
  3.  
  4. def csv_from_excel():
  5. wb = xlrd.open_workbook('Your_excel_file.xlsx')
  6. sh = wb.sheet_by_name('Sheet_name')
  7. dane3 = open('Name_of_new_csv_file.csv', 'w')
  8. wr = csv.writer(Name_of_new_csv_file, quoting=csv.QUOTE_ALL)
  9.  
  10. for rownum in range(sh.nrows):
  11. wr.writerow(sh.row_values(rownum))
  12.  
  13. Name_of_new_csv_file.close()
  14.  
  15. # runs the csv_from_excel function:
  16. csv_from_excel()
Add Comment
Please, Sign In to add comment