Print Excel workbook using python

前端 未结 5 1550
小鲜肉
小鲜肉 2021-01-03 12:36

Suppose I have an excel file excel_file.xlsx and i want to send it to my printer using Python so I use:

import os
os.startfile(\'path/to/file\',         


        
5条回答
  •  隐瞒了意图╮
    2021-01-03 13:40

    Turns out, the problem was with Microsoft Excel, os.startfile just sends the file to the system's default app used to open those file types. I just had to change the default to another app (WPS Office in my case) and the problem was solved.

提交回复
热议问题