bundles / IPython 9.10.0 / IPython / core / completer / position_to_cursor
function
IPython.core.completer:position_to_cursor
source: /IPython/core/completer.py :1677
Signature
def position_to_cursor ( text : str , offset : int ) → tuple[int, int] Summary
Convert the position of the cursor in text (0 indexed) to a line number(0-indexed) and a column number (0-indexed) pair
Extended Summary
Position should be a valid position in text.
Parameters
text: strThe text in which to calculate the cursor offset
offset: intPosition of the cursor in
text, 0-indexed.
Returns
(line, column): (int, int)Line of the cursor; 0-indexed, column of the cursor 0-indexed
See also
- cursor_to_position
reciprocal of this function
Aliases
-
IPython.core.completer.position_to_cursor