[Tutor] Python as a superior teaching language

D-Man dsh8290@rit.edu
Thu, 19 Apr 2001 10:26:19 -0400


On Thu, Apr 19, 2001 at 09:31:13AM +1000, Arthur Watts wrote:
| Guys,
| 
<readline stuff>

| 	>>> import rlcompleter
| 	>>> import readline
| 	>>> readline.parse_and_bind("tab: complete")
| 
| And you now have AutoCompleting on.  To use it, type part of a variable and
| press "<TAB>".  If there is only one variable matching, it will be filled in
| automatically, as in
...
| provide a command-line history.  By default, it is emacs style.  Use your
| arrow keys to go through your previous commands.  I however, prefer the 'vi'
| style line editing.  To do this, put a '.inputrc' file in your home
| directory with the following line
| 	set editing-mode vi

It is very cool.  Thanks for sharing.  It works with Python 2.1 under
cygwin as well.  

Except for the history stuff, you can get the same setup by putting
the line

"\t": complete

in the .inputrc file.

-D


PS, for all you *nix fans stuck with windo~1 out there :  2.1 with
    cygwin is _very_ cool.  It handles EOF properly (^D) and works
    with readline, as it is supposed to.  It also handles job control
    from bash properly (^Z suspends it and returns your shell prompt)