Programming/python [python3] 인스턴스의 클래스 이름 출력하기 - 기록용으로 남깁니다. 파이썬에서 현재 사용되는 인스턴스의 클래스명이 필요할 때가 있습니다. instanceA = ClassA() 라고 생성한 경우, type(instanceA).__name__ 값을 접근하면 ClassA 가 문자열로 나옵니다. python2 에서는 instanceA.__class__.__name__ 으로 접근할 수 있다고 하는데 2를 쓰지 않아서 확인이 안되네요. 공유하기 게시글 관리 구독하기sr's lair 저작자표시 동일조건 'Programming > python' 카테고리의 다른 글 [python3][vscode][pylance] operator "in" not supported for types literal and str int float 26,12 오류 끄기 (0) 2021.06.24 python 에서 tar.gz 파일 만들기 (0) 2021.06.15 [python] 소켓이 사용중인 포트 확인하기 (0) 2021.02.09 [python] json.dumps object of type bytes is not json serializable (0) 2020.12.22 [python3] smtp 로 여러명에게 이메일 보내기 (0) 2020.12.14 Contents 당신이 좋아할만한 콘텐츠 [python3][vscode][pylance] operator "in" not supported for types literal and str int float 26,12 오류 끄기 2021.06.24 python 에서 tar.gz 파일 만들기 2021.06.15 [python] 소켓이 사용중인 포트 확인하기 2021.02.09 [python] json.dumps object of type bytes is not json serializable 2020.12.22 댓글 0 + 이전 댓글 더보기