class HogeClass: def hoge(self): print(self.__class__.__name__) if __name__ == '__main__': HogeClass().hoge()
from inspect import currentframe def hoge(): print(currentframe().f_code.co_name) if __name__ == '__main__': hoge()
Recommended Posts