목록Python (48)
준호씨의 블로그

Python을 사용하다 보면 종종 만나는 오류 "No module named 'MySQLdb'"입니다. 해결 방법은 간단합니다. pip를 이용해서 mysqlclient를 설치해 주면 됩니다. mysqlclient pip install mysqlclient mysqlclient에 관한 정보는 https://pypi.org/project/mysqlclient/ 에서 볼 수 있습니다. MySQL-python Python2처럼 오래된 환경에서는 MySQL-python을 설치해야 될 수도 있습니다. pip install MySQL-python MySQL-python에 관한 정보는 https://pypi.org/project/MySQL-python/ 에서 볼 수 있습니다. 기타 OS나 환경에 따라서 mysql 관련..

지난 3월 1일 ChatGPT API가 공개되었습니다. https://openai.com/blog/introducing-chatgpt-and-whisper-apis Introducing ChatGPT and Whisper APIs Developers can now integrate ChatGPT and Whisper models into their apps and products through our API. openai.com 이제 누구나 손쉽게 ChatGPT API를 이용해서 애플리케이션을 제작할 수 있게 되었습니다. 다만 API를 호출하려면 비용이 발생하기 때문에 요금을 잘 알아보아야 합니다. API 요금 정보는 다음페이지에서 확인할 수 있습니다. https://openai.com/pricing P..

python의 버전을 확인하는 방법입니다. --version 옵션을 통해 버전을 확인할 수 있습니다. $ python --version Python 3.8.10 3.8.10 인 것을 확인할 수 있습니다. --version의 축약형인 -V옵션을 사용할 수도 있습니다. $ python -V Python 3.8.10 --help 옵션을 사용하면 -V (또는 --version)을 통해 python 버전을 확인할 수 있다고 나옵니다. $ python --help usage: /Users/junho85/.pyenv/versions/3.8.10/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ... Options and arguments (and corresp..

Python Django를 이용해서 만드는 웹애플리케이션을 Docker 이미지로 생성하는 방법을 정리해 봅니다. 제가 개발 중인 정원사들 시즌8 출석부앱을 기준으로 합니다. https://github.com/junho85/garden8 간단하게 요약하면 Dockerfile을 만들어주면 됩니다. Dockerfile 만들기 "Dockerfile"이라는 파일을 만들고 다음과 같이 내용을 입력합니다. # Use an official Python runtime as the base image FROM python:3.8 # Set the working directory in the container WORKDIR /app # Copy the requirements.txt file to the container C..