You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Add tkinter.Canvas.tk_print() and tkinter.Text.tk_print() to expose the native print dialog #153256
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 commentedon 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 commentedon 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 commentedon Jul 11, 2026
Great! See #43720 (comment)