[issue9387] Make python -m tkinter run tkinter demo

Alexander Belopolsky report at bugs.python.org
Tue Jul 27 01:10:01 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

On Mon, Jul 26, 2010 at 4:16 PM, Éric Araujo <report at bugs.python.org> wrote:
..
> I lack context: Why is being able to run “python -m tkinter” useful?

The missing context is in issue 9384.  I discovered that  python -m
tkinter did not work when I was looking for a simple way to
demonstrate the tkinter pop-under bug.  The demo code was already in
the package but would not run using -m option.

> Tests can be run directly or via regrtest, and I recall Guido saying that using modules as scripts
> was an anti-pattern to him, i.e. sometimes useful but not always necessary.

I have not heard it from Guido, but I agree with one exception.  If
the module contains doctests, it is useful to have doctest run
boilerplate in the file.   While regrtest runs most of the existing
doctests, it does not discover them and there is no option to run
doctests separately from unit tests as far as I know.

Note that tkinter._test() is not really a test, it is a tiny demo
program.  (I am changing the title accordingly.)   I think exposing it
as python -m tkinter would provide one obvious way for users to see if
they have working tkinter and what its widgets look like.

----------
title: Make python -m tkinter run tkinter test -> Make python -m tkinter run tkinter demo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9387>
_______________________________________


More information about the Python-bugs-list mailing list