bundles / IPython 9.11.0 / IPython / core / interactiveshell / InteractiveShell / complete
function
IPython.core.interactiveshell:InteractiveShell.complete
Signature
def complete ( self , text , line = None , cursor_pos = None ) Summary
Return the completed text and a list of completions.
Parameters
text: stringA string of text to be completed on. It can be given as empty and instead a line/position pair are given. In this case, the completer itself will split the line like readline does.
line: string, optionalThe complete line that text is part of.
cursor_pos: int, optionalThe position of the cursor on the input line.
Returns
text: stringThe actual text that was completed.
matches: listA sorted list with all possible completions.
Notes
The optional arguments allow the completion to take more context into account, and are part of the low-level completion API.
This is a wrapper around the completion mechanism, similar to what readline does at the command line when the TAB key is hit. By exposing it as a method, it can be used by other non-readline environments (such as GUIs) for text completion.
Examples
In [1]: x = 'hello' In [2]: _ip.complete('x.l') Out[2]: ('x.l', ['x.ljust', 'x.lower', 'x.lstrip'])Aliases
-
IPython.InteractiveShell.complete