티스토리 뷰
728x90
import inspect
def method_name():
return inspect.stack()[1][3]
def method_name_caller():
return inspect.stack()[2][3]
def asdf():
print(method_name_caller())
print(method_name())
def asdf2():
print(method_name_caller())
print(method_name())
asdf()
Determine function name from within that function (without using traceback)
In Python, without using the traceback module, is there a way to determine a function's name from within that function? Say I have a module foo with a function bar. When executing foo.bar(), is th...
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[Python] union, intersection, difference (0) | 2022.03.11 |
---|---|
[Java] Calendar.SUNDAY(1), DayOfWeek.SUNDAY(7) (0) | 2022.03.11 |
[SQL] literal string 'Single quotation', "database identifier" (0) | 2022.03.11 |
[Git] git ls-remote --heads git@github.com:user/repo.git branch-name (0) | 2022.02.27 |
[Python] replace (all) string `re.sub` (0) | 2022.02.27 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Kluge
- 테슬라
- 어떻게 능력을 보여줄 것인가?
- 테슬라 레퍼럴
- 인스타그램
- 연애학개론
- Bot
- 메디파크 내과 전문의 의학박사 김영수
- COUNT
- 모델 Y 레퍼럴
- 유투브
- 팔로워 수 세기
- 모델y
- 책그림
- 테슬라 추천
- 레퍼럴
- 클루지
- 테슬라 레퍼럴 적용 확인
- 테슬라 리퍼럴 코드
- 할인
- 개리마커스
- 김달
- 테슬라 리퍼럴 코드 혜택
- follower
- wlw
- 테슬라 크레딧 사용
- 테슬라 리퍼럴 코드 생성
- 테슬라 레퍼럴 코드 확인
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함