我想从一个Excel文件中提取一张纸并将其附加到另一个Excel文件中。我可以使用以下代码做到这一点,但不保留源工作表标题格式(字体,背景色)。请帮助我。
**dest_file = "/tmp/destfile.xlsx" # Destination file which already has two sheets
writer = pd.ExcelWriter(dest_file)
src_file = "/tmp/tmpfile.xlsx" # Source file which has 'Cell Scope' named sheet
data = pd.read_excel(src_file, sheet_name='Cell Scope')
data.to_excel(writer, sheet_name='Cell Scope', index=False)
writer.save()
writer.close()**
谢谢。