Python attribute(속성) 추가

사용 버전 : Python 3.6.8
사용 프로그램 : Atom 1.37.0 x64


파이썬 attribute 추가에 대해서 알아보겠습니다.


파이썬 프로그램은 없는 속성을 만들 수 있습니다.








nothave라는 속성이 없으므로, 오류가 발생합니다.


없는 속성에 값을 부여하면, 새로운 속성이 생성됩니다.







example 클래스에는 nothave라는 속성이 없지만, 값을 지정하면 새로운 속성이 만들어집니다.



끝.


카테고리: Python, Standard Library

댓글

이 블로그의 인기 게시물

Python urllib.parse.quote()

Forensics .pyc 파일 .py로 복구하기

KiCad 시작하기 7 (FreeRoute 사용하기 2)

음악 총보(Score), 파트보(Part)

KiCad 시작하기 3 (새로운 소자 추가하기)

Kivy 시작하기 12 (Pyinstaller로 exe 파일 만들기)

딩기 요트 명칭

Android App architecture: State holders and UI state

Android Default background color setting

Android Compose automation for getting localized images to use on Play Store app image