티스토리 뷰

method를 변수에 담아보자

변수에 method 할당하기

def test_method():
    print('print method call')

def main():
    test = test_method
    print(type(test))
    test()
    return True

if __name__ == '__main__':
    main()
<class 'function'>
print method call


'Develop > Python' 카테고리의 다른 글

[PyQt] Qmessage, 일명 Popup 띄우기  (0) 2018.06.03
라즈베리파이 우분투에 Python 설치하기  (2) 2018.05.20
[PyQt] 설치 및 .ui 사용하는 법  (0) 2018.04.08
[Python] 전역 변수  (0) 2018.04.01
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
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 29 30 31