From fd212a441d79d3a9875798310b8670a36eaa04db Mon Sep 17 00:00:00 2001 From: chrin Date: Fri, 17 Nov 2023 11:23:56 +0100 Subject: [PATCH] line_no in utily.py to replace _line --- utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils.py b/utils.py index 0258662..6d92875 100644 --- a/utils.py +++ b/utils.py @@ -10,3 +10,15 @@ def _line(): int: Current line number. """ return currentframe().f_back.f_lineno + + +def line_no(): + """Macro to return the current line number. + + The current line number within the file is used when + reporting messages to the message logging window. + + Returns: + int: Current line number. + """ + return currentframe().f_back.f_lineno