Skip to content

Commit a40a494

Browse files
doc: 'import tkinter as tk' in examples
1 parent a7ed0c9 commit a40a494

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Doc/library/tkinter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,9 @@ Tk allows you to register and unregister a callback function which will be
10071007
called from the Tk mainloop when I/O is possible on a file descriptor.
10081008
Only one handler may be registered per file descriptor. Example code::
10091009

1010-
import tkinter
1011-
widget = tkinter.Tk()
1012-
mask = tkinter.READABLE | tkinter.WRITABLE
1010+
import tkinter as tk
1011+
widget = tk.Tk()
1012+
mask = tk.READABLE | tk.WRITABLE
10131013
widget.tk.createfilehandler(file, mask, callback)
10141014
...
10151015
widget.tk.deletefilehandler(file)

Doc/library/tkinter.ttk.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,9 +1290,9 @@ option. If you don't know the class name of a widget, use the method
12901290
some padding and a different background color::
12911291

12921292
from tkinter import ttk
1293-
import tkinter
1293+
import tkinter as tk
12941294

1295-
root = tkinter.Tk()
1295+
root = tk.Tk()
12961296

12971297
ttk.Style().configure("TButton", padding=6, relief="flat",
12981298
background="#ccc")

0 commit comments

Comments
 (0)