Looking for IT consultant?
If you are looking for skilled software developer or devops engineer, contact me! I just might be able to help you. Reach me at: karol at karoltomala dot com
Tag Archives: class method
How to get class method name in Python?
There are two ways to do this. You can either do: def whoami(): “””Returns name of the method.””” import sys return sys._getframe(1).f_code.co_name def callersname(): “””Returns name of the caller.””” import sys return sys._getframe(2).f_code.co_name Or you can simply do: import inspect … Continue reading