[Tutor] Idea to help newbies - let's define 'help'

Patrick K. O'Brien pobrien@orbtech.com
Fri, 8 Jun 2001 11:13:57 -0500


Here is an idea. When you run the python interpreter in interactive mode for
the very first time, it is probably pretty common to type the word 'help'
just to see what happens. And guess what you get:

>>> help
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
NameError: name 'help' is not defined
>>>

This is not exactly the friendliest response you and I could think of giving
someone. (Especially if we want them to love Python the way we do.) So how
about joining me in a little project here where we define 'help' for use in
interactive mode? That means we need to create a script that will be pointed
to by PYTHONSTARTUP or some other mechanism. The script (I'll suggest the
name interactive.py) needs to contain useful functions like Remco Gerlich's
doc() function as well as others. In addition, there needs to be a function
named help() that will work with no parameters passed to it (at least none
required).

That's as far as I've gone with the idea. Anyone else interested?

---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."