how to quickly convert multiple csv files into xls files in batches
how to quickly convert multiple csv files into xls files in batches
import pandas as pd
def csv_to_xlsx_pd(csv_pt, encoding='utf-8'):
csv = pd.read_csv(csv_pt, encoding=encoding)
csv.to_excel(csv_pt.split('.')[0]+'.xlsx', sheet_name='data')
-sharp TODO os.listdir
if __name__ == '__main__':
csv_to_xlsx_pd()
Previous: What's the difference between Element, HTMLElement, HTMLHtmlElement?
Next: Laravel 5.5.How to get insertID by writing sql natively