xlwt 已安装,在 python 3.9 上
current_dir = os.path.dirname(__file__)
pathXLSX = os.path.join(current_dir,'moveData',weapon[0]+".xlsx")
pathXLS = os.path.join(current_dir,'moveData',weapon[0]+".xls")
df.to_excel((os.path.abspath(pathXLSX)+"").replace('/','\\'),index=False)
xlsx_to_xls(pathXLSX,pathXLS)
def xlsx_to_xls(xlsx_filename, xls_filename):
df = pd.read_excel(xlsx_filename, engine='openpyxl')
df.to_excel(xls_filename, index=False, engine='xlwt')
xlwt 已安装,在 python 3.9 上
def xlsx_to_xls(xlsx_filename, xls_filename):
df = pd.read_excel(xlsx_filename, engine='openpyxl')
df.to_excel(xls_filename, index=False, engine='xlwt')