python - Make CSVs from Excel Sheet Tabs -


i'm using below python script make csvs excel sheet multiple tabs. though doesn't give error , prints out " csvs made " i'm unable find csv anywhere should've been produced. i've made changes , still returns blank.

def excel2csv(excelfile, sheetname, csvfile):     import xlrd     import csv      file_location = "c:\users\aqureshi\desktop\programming\consolidateddataviewsyellowed.xlsx"     workbook = xlrd.open_workbook(file_location)     worksheet = workbook.sheet_by_name ("arc")     csvfile = open (arc.csv,'wb')     wr = csv.writer (csvfile, quoting = csv.quote_all)      rownum in xrange (worksheet.nrows):         wr.writerow(             list(x.encode('utf-8') if type (x) == type (u'') else x                  x in worksheet.row_values (rownum)))          csvfile.close()      print(excel2csv()) 

any appreciated.


Comments