I think you mean rlcompleter Completed Object.
You can use it like this:
from rlcompleter import Completer line = str(...) completer = Completer(self.interpreter.locals) suggestion = completer.complete(line, 0) self.insertPlainText(suggestion)
The numeric argument indicates the nth sentence, and you can iterate over it until it returns None .
For example, let's say that
>>> my_data = '012345'
then
>>> completer.complete('my_', 0) 'my_data' >>> completer.complete('my_data.s', 0) 'my_data.split(' >>> completer.complete('my_data.s', 1) 'my_data.splitlines('
Note that while interpreter.locals used in the code above, you can apply a broader search (but be sure to include a dictionary).
Ohad
source share