I`m trying to convert .xls to .csv but when i run the code below nothing happens.
import xlrd
import csv
def csv_from_excel():
wb = xlrd.open_workbook('d://Documents and Settings//tdrub//Desktop//TreinamentoPython XLS-CSV//Teste.xls')
sh = wb.sheet_by_name('Sheet1')
Agencia = open('d://Documents and Settings//tdrub//Desktop//Agencia.csv', 'wb')
wr = csv.writer(Agencia, quoting=csv.QUOTE_ALL)
for rownum in xrange(sh.nrows):
wr.writerow(sh.row_values(rownum))
Agencia.close()
The directory is correct, the sheet name is correct but when i run the code no .csv file is created.
I appreciate if someone can help me :)