Send an excel file to print in Python

The task is: after the script written in Python generates an xlsx file, send it to print. How can I do this using Python or using system calls? I found that there is a pycups module that allows you to work with the printer and send files to it, but it is only for Unix-like systems. I am interested in the features for Windows and Linux (you can do it separately for each).

Author: Chudvan, 2020-10-30

1 answers

For Windows, you can use os. startfile.

Example:

import os
os.startfile('path/to/file', 'print')
 1
Author: gil9red, 2020-10-30 10:35:28