Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个小的 python 代码来打开一个 Excel 文件。现在我想用不同的名称但格式相同的“另存为”。我该怎么做..任何帮助都会很棒。FK
只需使用 \\ 而不是 /
import win32com.client office = win32com.client.Dispatch("Excel.Application") wb = office.Workbooks.Open("C:/FileName.xlsx") wb.SaveAs(Filename:="C:\\NewFileName.xlsx") wb.Close() office.Quit()