Prints a line of source code, highlighting a particular character position in the line. Useful for displaying the context of error messages.
If the line is more than width characters, the line is truncated accordingly and ‘…’ characters are inserted at the front and/or end.
It looks like this:
there_is_a_syntax_error_here :
^
Parameters: | line : unicode
col : int, optional
file : writeable file-like object, optional
tabwidth : int, optional
width : int, optional
|
---|