Python and Tkinter Programming by John Grayson

Kevin Walzer kw at codebykevin.com
Sat May 29 10:03:28 EDT 2010


> Is printing from GUI still a 'not-happening' thing with Tkinter ? I
> have just started learning it.

Tkinter doesn't wrap native printing API's. There are a few extensions 
that do it, but they are platform specific and not complete.

The usual ways of printing are like this:

1. If you're outputting data from the text widget, write that to a 
temporary text file and print via lpr.

2. If you're outputting data from the canvas, write that to a temporary 
postscript file and print via lpr.

This is on Unix/MacOS. Not sure what the equivalent API on Windows is.

--Kevin

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com



More information about the Python-list mailing list