[Python-Dev] a simpler way to invoke pydoc, pdb, unittest, etc
ilya at bluefir.net
Mon Sep 27 03:46:00 CEST 2004
a number of standard python modules come with a command line interfaces,
e.g. pydoc.py, pdb.py , unittest.py, timeit.py, uu.py
But it appears that there is no convenient out-of-the-box way to invoke
these tools from command line...
Basically one either has to write wrappers or to
invoke them like this: python /usr/lib/python2.3/pdb.py
Neither approach is convenient...
Am I missing something obvious? If not, then would the following make
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__
would be equivalent to
A possible variation of the same idea would be to have an explicit
command line option -m (or -M). More typing, but less magic...
PS. An obvious alternative would be to install wrapper
scripts/symlinks next to python, but I don't understand python packaging
well enough to make a judgement here. One obvious problem with wrapper
scripts would be a difficulty of versioning, I wouldn't want to have
pydoc2.2 pydoc2.3.1 pydoc2.3, etc in my /usr/bin
More information about the Python-Dev