System printer object

Terry Reedy tjreedy at udel.edu
Tue Jan 8 01:16:37 EST 2019


On 1/7/2019 5:17 PM, Dave wrote:
> I need to print to one or both of my system printers.  I have not found 
> a printer object in Python or in Tkinter.  This needs to work with 
> Linux, Window, and Mac.  Can someone point me in the right direction? 
> Ultimately, I want to have a File/Print in the menu that lets me select 
> the printer and properties.

IDLE can print editor contents to the default printer.  The code is in 
idlelib.iomenu.  The subprocess commands used are

print-command-posix=lpr %%s
print-command-win=start /min notepad /p %%s

I believe %%s becomes the name of the saved file.



-- 
Terry Jan Reedy





More information about the Python-list mailing list