Website hosting service by Active-Venture.com
  

 Back to Index

7.21 rlcompleter -- Completion function for GNU readline

Availability: Unix.

The rlcompleter module defines a completion function for the readline module by completing valid Python identifiers and keywords.

This module is Unix-specific due to its dependence on the readline module.

The rlcompleter module defines the Completer class.

Example:

>>> import rlcompleter
>>> import readline
>>> readline.parse_and_bind("tab: complete")
>>> readline. <TAB PRESSED>
readline.__doc__          readline.get_line_buffer  readline.read_init_file
readline.__file__         readline.insert_text      readline.set_completer
readline.__name__         readline.parse_and_bind
>>> readline.

The rlcompleter module is designed for use with Python's interactive mode. A user can add the following lines to his or her initialization file (identified by the PYTHONSTARTUP environment variable) to get automatic Tab completion:

try:
    import readline
except ImportError:
    print "Module readline not available."
else:
    import rlcompleter
    readline.parse_and_bind("tab: complete")

  

 

© 2002-2004 Active-Venture.com Webhosting Service

 

Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to http://python.org/doc/

 

Cheap domain registrar provides cheap domain registration, buy domain name and domain transfer from $5.95/year only   Cheap domain registration : Buy domain name and enjoy comprehensive free services