Tk 8.7/9.0 added the tk print command, which opens the native platform print dialog to print the contents of a canvas or text widget. tkinter currently has no interface to it.
I propose adding a tk_print() method to tkinter.Canvas and tkinter.Text (the only widgets tk print supports).
This complements the other native dialog wrappers in tkinter (tkinter.colorchooser, tkinter.filedialog, tkinter.fontchooser).
I will add this to IDLE (20-year-old issue above). Could you (Claude?) look at Canvas.print for turtle? If that were added, a Print button could be conditionally added to the turtledemo frame.
Activity
gh-153256: Add tk_print() methods to tkinter Canvas and Text (GH-153257)
terryjreedy commented on Jul 11, 2026
I will add this to IDLE (20-year-old issue above). Could you (Claude?) look at Canvas.print for turtle? If that were added, a Print button could be conditionally added to the turtledemo frame.
serhiy-storchaka commented on Jul 11, 2026
Note that in older Python versions you can use w.tk.call('tk', 'print', w) (do not work on Tk 8.6). w.tk_print() in main is just sugar.
terryjreedy commented on Jul 11, 2026
Great! See #43720 (comment)