Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get current function name in python3

import inspect
def myfirstfunc():
    print(inspect.currentframe().f_code.co_name)
    # OR
    print(inspect.stack()[0][3])
myfirstfunc()
 
PREVIOUS NEXT
Tagged: #current #function
ADD COMMENT
Topic
Name
9+3 =