일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Database
- git
- PostgreSQL
- docker
- Flask
- Laravel
- list
- pandas
- Paper
- pytorch
- format
- Converting
- Package
- Mac
- AI
- enV
- file
- KAKAO
- GitLab
- DB
- Windows
- LLM
- TORCH
- judge
- evaluation
- numpy
- Python
- Linux
- Container
- CUDA
- Today
- Total
목록Python (34)
Daily Develope
환경Python 3.9.7- modules : psycopg2Postgresql (Container, version:alpine3.18)- host : 127.0.0.1- port : 5432- database : mydb- 컨테이너 배포 샘플코드Connection Classimport psycopg2import loggingclass DBBaseController: def __init__(self, host:str="127.0.0.1", port:int=5432) -> None: self.__connect(host=host, port=port) def __connect(self, host:str="127.0.0.1", port:int=5432): try: ..
방법 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..
설치 pip install selenium pip install bs4 사용 예시 일반적인 사용 from selenium.webdriver.chrome.service import Service as ChromeService from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By # init. driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install())) # load chrome webdriver driver.set_window_size(1200, 900) driver.set_window_positi..
리스트 (List) List의 Item 한 줄씩 출력 my_list = ["line1", "line2", "line3"] print(f"{my_list}", sep="\n")List 간단한 명령 한 줄로 처리 ### 예) a 값이 None 인 경우를 제외하고 덧셈 값 반환 sample = [[1, 2], [3, 4], [None, 6]] sample = [a+b for a, b in sample if a != None] >> print(sample) [3, 7]List 의 index 및 값 순차출력 t_list = [1, 5, 7, 33, 39, 52] for tup in enumerate(t): print(tup) ### output (0, 1) (1, 5) (2, 7) (3, 33) (4, 39) (..