bundles / IPython latest / IPython / core / completer / cursor_to_position
function
IPython.core.completer:cursor_to_position
source: /IPython/core/completer.py :1648
Signature
def cursor_to_position ( text : str , line : int , column : int ) → int Summary
Convert the (line,column) position of the cursor in text to an offset in a string.
Parameters
text: strThe text in which to calculate the cursor offset
line: intLine of the cursor; 0-indexed
column: intColumn of the cursor 0-indexed
Returns
: Position of the cursor in ``text``, 0-indexed.
See also
- position_to_cursor
reciprocal of this function
Aliases
-
IPython.core.completer.cursor_to_position