summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-07-27 14:16:32 +0000
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-07-27 14:16:32 +0000
commitc02cc2707a8ed58896511f7ee151b5509873afc3 (patch)
tree5d1a66a8fc328729bd556ea879b4a99b5ce37ecf
parent5a63183a8b8a9e177f97feac975850df5e6f98aa (diff)
downloadcpython-git-c02cc2707a8ed58896511f7ee151b5509873afc3.tar.gz
Issue #9384: python -m tkinter will now display a simple demo applet.
-rw-r--r--Doc/library/tkinter.rst4
-rw-r--r--Lib/tkinter/__main__.py7
-rw-r--r--Misc/NEWS2
3 files changed, 12 insertions, 1 deletions
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index 7bb54fd4fa..cf92ed4698 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -9,7 +9,9 @@
The :mod:`tkinter` package ("Tk interface") is the standard Python interface to
the Tk GUI toolkit. Both Tk and :mod:`tkinter` are available on most Unix
platforms, as well as on Windows systems. (Tk itself is not part of Python; it
-is maintained at ActiveState.)
+is maintained at ActiveState.) You can check that :mod:`tkinter` is properly
+installed on your system by running ``python -m tkinter`` from the command line;
+this should open a window demonstrating a simple Tk interface.
.. seealso::
diff --git a/Lib/tkinter/__main__.py b/Lib/tkinter/__main__.py
new file mode 100644
index 0000000000..757880d439
--- /dev/null
+++ b/Lib/tkinter/__main__.py
@@ -0,0 +1,7 @@
+"""Main entry point"""
+
+import sys
+if sys.argv[0].endswith("__main__.py"):
+ sys.argv[0] = "python -m tkinter"
+from . import _test as main
+main()
diff --git a/Misc/NEWS b/Misc/NEWS
index a6a7c20f26..3f565f6f7c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -473,6 +473,8 @@ C-API
Library
-------
+- Issue #9384: python -m tkinter will now display a simple demo applet.
+
- The default size of the re module's compiled regular expression cache has
been increased from 100 to 500 and the cache replacement policy has changed
from simply clearing the entire cache on overflow to randomly forgetting 20%