본문 바로가기

python5

(Eng) error) Docker) Solving the Psycopg2 Installation Issue in Docker Containers Docker ) Solving the Psycopg2 Installation Issue in Docker Containers (Eng) Note: This article was written by ordering the chatGPT to write with my idea, and I refined and completed it. 0. When working with Python applications in a Docker container, one common issue you might face is the failure to install the psycopg2 pip package. This issue may arise when attempting to install the package with.. 2023. 2. 11.
DRF stu.d.a A0) DRF + TDD + CI 0. 정말 오랜만의 블로그 포스팅 한동안 새 글이 없었음에도 일일 방문자가 꽤 많아 기분이 좋았다. 1. 근래에는 Django REST framework를 이용한 API 서버 개발을 공부하고 있다. 코드: https://github.com/dpcalfola/study_django_rest_framework 2. 구조 * 코드는 TDD(Test Driven Development)에 입각하여 작성 * Docker-compose를 사용하여 모든 컨테이너를 통합, 제어하여 빌드 * CI(Continus Integration) 구현 - Github Action을 통해 매 git push 때마다 빌드, Test Code, Lint 등을 체크 3. 문제 해결 일화 - env 숨김 파일을 Github Action에 적.. 2022. 8. 29.
error, 파이참버그) ValueError: invalid literal for int() with base 10: '' / 파이참 인풋 버그 error, 파이참, PyCharm) ValueError: invalid literal for int() with base 10: '' / 파이참 인풋 버그 0. 요약 : PyCharm 2022.1.1 의 알려진 버그 PY-54238 - 콘솔에서 인풋 값을 입력받을 때 두 번째 인풋이 강제로 empty string로 변환되는 현상 해결방법: Run > Run/Debug Configurations > Execution > Emulate terminal in output console > 체크박스 체크 (2022/06/02 추가 내용) 정식 릴리즈된 PyCharm 2022.1.2 업데이트로 버그 픽스됨 1. 버그 내용 콘솔에서 인풋 값을 키보드로 직접 입력받을 때 두 번째 인풋이 강제로 empty strin.. 2022. 5. 30.
파이썬PS) 백준 6603 로또. 백트래킹 https://www.acmicpc.net/problem/6603 6603번: 로또 입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 한 줄로 이루어져 있다. 첫 번째 수는 k (6 < k < 13)이고, 다음 k개 수는 집합 S에 포함되는 수이다. S의 원소는 오름차순으로 www.acmicpc.net 파이썬 PS) 백준 6603 로또. 백트래킹 알고리즘 - dfs를 이용한 백트래킹 1. 코드 1 import sys 2 3 while True: 4 nums = list(map(int, sys.stdin.readline().split())) 5 if nums[0] == 0: 6 break 7 8 nums.pop(0) 9 V = 6 10 stack = [] 11 12 13 def dfs(.. 2022. 4. 12.
python ) 문자열 파싱 파이썬에서 문자열은 list 처럼 substring 문법을 사용할 수 있다. string[index] 처럼 사용 가능하다. string_a = "012345678" result = string_a[1:8:2] # index 1 이상 미만까지 2칸식 증가 # 1357 result_2 = string_a[2:] # index 2 이상 끝까지 # 2345678 result_3 = string_a[:3] # index 3 미만까지 # 012 result_4 = string_a[:-3] # 뒤에서부터 3개 제거하고 전부 # 012345 result_5 = string_a[-3:] # (뒤에서부터 3개) 부터 끝까지 # 678 result_6 = string_a[4] # index 4 # 4 print(result.. 2022. 2. 20.