A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/049097.html below:

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

[Python-Dev] a simpler way to invoke pydoc, pdb, unittest, etcIlya Sandler ilya at bluefir.net
Mon Sep 27 03:46:00 CEST 2004
A problem:

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
sense?

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...

Ilya

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 mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4