How to send print job to printer in python

BK C. picture BK C. · Apr 14, 2016 · Viewed 12.1k times · Source

I used Tkinter to draw some lines in python and I would like to print that picture to usb connected and/or network printer in Windows. How should I do that?

Answer

TheLazyScripter picture TheLazyScripter · Apr 14, 2016

try this! It uses os module to start the file in the default printer!

import os

os.startfile("YourDocument", "print")