smpl_debug.debug.get_line_number_file

smpl_debug.debug.get_line_number_file(split=True, _back=0)[source]

Gets the current filename and the current linenumber within it.

Parameters

splitbool

Indicates whenever the folders above of the file should be included in the returned filename.

_backint

Number of stack/frames to go back.

Returns

filenumberint

First element in the return array

filenamestr

Second element in the return array

Examples

>>> get_line_number_file()
(1, '<doctest smpl.debug.get_line_number_file[0]>')
>>> for i in range(2):
...     get_line_number_file()
(2, '<doctest smpl.debug.get_line_number_file[1]>')
(2, '<doctest smpl.debug.get_line_number_file[1]>')