summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-17 18:39:55 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-17 18:39:55 (GMT)
commit14fc4270da5db43574d46d055a5f794ed33b271f (patch)
tree3d937a96350b067c7dcee6425fe14617dd8b9ef5 /Lib/tkinter/__init__.py
parent330231238327558337b9d8dbabe3a3b02641501d (diff)
downloadcpython-14fc4270da5db43574d46d055a5f794ed33b271f.zip
cpython-14fc4270da5db43574d46d055a5f794ed33b271f.tar.gz
cpython-14fc4270da5db43574d46d055a5f794ed33b271f.tar.bz2
Tkinter, step 2: adapt imports.
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r--Lib/tkinter/__init__.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index d600f29..49ca8a5 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -18,14 +18,14 @@ Actions are bound to events by resources (e.g. keyword argument
command) or with the method bind.
Example (Hello, World):
-import Tkinter
-from Tkconstants import *
-tk = Tkinter.Tk()
-frame = Tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
+import tkinter
+from tkinter.constants import *
+tk = tkinter.Tk()
+frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
-label = Tkinter.Label(frame, text="Hello, World")
+label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
-button = Tkinter.Button(frame,text="Exit",command=tk.destroy)
+button = tkinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()
"""
@@ -34,11 +34,11 @@ __version__ = "$Revision$"
import sys
if sys.platform == "win32":
- import FixTk # Attempt to configure Tcl/Tk without requiring PATH
+ # Attempt to configure Tcl/Tk without requiring PATH
+ from tkinter import _fix
import _tkinter # If this fails your Python may not be configured for Tk
-tkinter = _tkinter # b/w compat for export
TclError = _tkinter.TclError
-from Tkconstants import *
+from tkinter.constants import *
try:
import MacOS; _MacOS = MacOS; del MacOS
except ImportError:
@@ -1692,7 +1692,7 @@ class Tk(Misc, Wm):
base_tcl = os.path.join(home, '.%s.tcl' % baseName)
base_py = os.path.join(home, '.%s.py' % baseName)
dir = {'self': self}
- exec('from Tkinter import *', dir)
+ exec('from tkinter import *', dir)
if os.path.isfile(class_tcl):
self.tk.call('source', class_tcl)
if os.path.isfile(class_py):