bundles / IPython 9.5.0 / IPython / utils / tokenutil / line_at_cursor
function
IPython.utils.tokenutil:line_at_cursor
source: /IPython/utils/tokenutil.py :63
Signature
def line_at_cursor ( cell : str , cursor_pos : int = 0 ) → tuple[str, int] Summary
Return the line in a cell at a given cursor position
Extended Summary
Used for calling line-based APIs that don't support multi-line input, yet.
Parameters
cell: strmultiline block of text
cursor_pos: integerthe cursor position
Returns
: (line, offset): (string, integer)The line with the current cursor, and the character offset of the start of the line.
Aliases
-
IPython.utils.tokenutil.line_at_cursor