[Python-Dev] a simpler way to invoke pydoc, pdb, unittest, etc

Barry Warsaw barry at python.org
Mon Sep 27 16:51:28 CEST 2004


On Sun, 2004-09-26 at 21:46, Ilya Sandler wrote:

> When a script specified from command line is not found and the script name
> does not end with py, treat the script as a module name and execute
> that module as __main__
> 
> So
> python pdb
> would be equivalent to
> python /usr/lib/python2.3/pdb.py
> 
> A possible variation of the same idea would be to have an explicit
> command line option -m (or -M). More typing, but less magic...

With the command line switch, +1.

One problem with the "just install it" approach is that you often get
Python from downstream packagers that make their own decisions about
which additional scripts to include.  There's also namespace collision
issues in bin directories to deal with.  So Ilya's suggestion avoids
both of those problems.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20040927/3925af92/attachment.pgp


More information about the Python-Dev mailing list