일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- docker
- PostgreSQL
- GitLab
- git
- pytorch
- Flask
- Database
- evaluation
- file
- Python
- AI
- curl
- Windows
- Laravel
- KAKAO
- Paper
- enV
- CUDA
- LLM
- pandas
- Mac
- Container
- TORCH
- numpy
- judge
- Converting
- Linux
- list
- DB
- format
Archives
- Today
- Total
목록2023/09/11 (1)
Daily Develope
[Python] 클래스 속성의 getter & setter 정의
방법 1. 내장 property method 클래스의 속성값에 대한 getter, setter, destructor 동작을 method로 정의하고, 내장함수인 property를 사용해 해당하는 속성과 연결시켜 사용. 샘플코드 # Python program showing a use of property() function class Geeks: def __init__(self): self._age = 0 # function to get value of _age def get_age(self): print("getter method called") return self._age # function to set value of _age def set_age(self, a): print("setter metho..
Develope/Python
2023. 9. 11. 14:50