[Python-Dev] A kind of configuration question

Moore, Paul Paul.Moore@uk.origin-it.com
Fri, 6 Apr 2001 09:55:38 +0100


On Thu, 5 Apr 2001, Cameron Laird wrote:
> Why's there no Win* executable pydoc?

There's an issue on Windows, because there are two types of executable
(console and GUI). I've raised a bug report on this (407300), but the action
taken was to remove the pydoc script (as opposed to the module) from the
Windows installer, although there is still a start menu entry.

The problem is that pydoc does two things - first, it starts a web server
(with a small GUI control interface). This script needs to be run as a GUI
command, to avoid an unnecessary console window. This is what the entry on
the start menu does. The other thing is to support the command line usage
"pydoc XXX". For this, I believe there should be a console command. A small
"pydoc.bat" as follows would provide this functionality:

--- pydoc.bat ---
@echo off
if "%1"=="" pythonw -c "import pydoc; pydoc.cli()"
if NOT "%1"=="" python -c "import pydoc; pydoc.cli()" %1 %2 %3 %4 %5 %6 %7
%8 %9
---

I do the test on %1 so that if the command is called without any arguments,
it uses pythonw to spawn the GUI webserver, whereas with arguments it does
the command line stuff.

Paul Moore