And now for something completely boneheaded...

Remco Gerlich scarblac-spamtrap at pino.selwerd.cx
Wed Sep 8 08:43:18 EDT 1999


Warren 'The Howdy Man' Ockrassa <warren at nightwares.com> wrote:
> It's... the obvious question of the day. Or perhaps the hour.
> 
> So I have
> 
>   import sys
> 
> From that how can I find out what sys can do?

Other people have also given answers, but the one with tab-completion
is a "quick and dirty" way...

It works if you're on Unix only, iirc. Put this in a file
~/.pythonrc:
import rlcompleter, readline
readline.parse_and_bind('tab: complete')

And set PYTHONSTARTUP to ~/.pythonrc .

Then you can use Tab in the interpreter to show different
ways of expanding something:
import sys
sys.<TAB><TAB>

It'll show what you can fill in after sys. Very useful.

This probably uses one of the other methods mentioned internally.
-- 
Remco Gerlich,  scarblac at pino.selwerd.cx
  2:40pm  up 21 days, 21:06,  5 users,  load average: 0.21, 0.13, 0.10




More information about the Python-list mailing list