본문 바로가기

파이썬75

Chatgpt 이용한 프로그램 짜기 6 - 파이썬 환율 변환기 ✔ GPT 입력 : 파이썬으로 환율 변환기를 만들어줘 가입이 필요 없는 방식으로 pip install requests ✔ GPT 가 작성한 코드 import requests def get_exchange_rate(base_currency, target_currency): url = f"https://api.exchangerate-api.com/v4/latest/{base_currency}" response = requests.get(url) data = response.json() return data["rates"].get(target_currency) def currency_converter(amount, base_currency, target_currency): exchange_rate = get_.. 2023. 7. 27.
Chatgpt 이용한 프로그램 짜기 5 - 파이썬(CPU, RAM, 네트워크 사용량) ✔ gpt입력 내용 : 매초마다 CPU, RAM 및 네트워크 사용량을 출력하는 프로그램을 Python으로 작성해줘import psutil import time def monitor_system(): while True: cpu_percent = psutil.cpu_percent(interval=1) ram_usage = psutil.virtual_memory().percent network_stats = psutil.net_io_counters() network_sent = network_stats.bytes_sent network_recv = network_stats.bytes_recv print(f"CPU Usage: {cpu_percent}%") print(f"RAM Usage: {ram_usage.. 2023. 7. 19.
Chatgpt 이용한 프로그램 짜기 4 - 파이썬(QR코드 생성) ✔ gpt입력 내용 : Python에서 QR 코드를 생성하는 코드 작성해줘 import qrcode def generate_qr_code(data, filename): qr = qrcode.QRCode(version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4) qr.add_data(data) qr.make(fit=True) qr_image = qr.make_image(fill_color="black", back_color="white") qr_image.save(filename) data = "https://www.example.com" filename = "qr_code.png" generate_qr_code(.. 2023. 7. 18.
Chatgpt 이용한 프로그램 짜기 1 - 파이썬(숫자맞추기게임) chat gpt를 이용해 파이썬으로 만들 수 있는 작업을 시행할 예정이다. 최종 목표는 gpt만을 이용하여 영상 자막을 실시간으로 번역해주는 작업을 할 예정이다. api의 경우에는 스프링부트를 이용할 예정이고 기본적인 내용은 파이썬을 이용할 예정이다. 시간이 가용하다면 프론트단까지 꾸미는게 목적이다. 그전에 간단하게 gpt를 이용하여 프로그램을 짜는 방법을 사용해볼 예정이다. ✔ Chat gpt만을 이용한 프로그래밍 - 이동 https://chat.openai.com/ // 주소 ✔ gpt에게 질문할 내용 파이썬 숫자 맞추기 게임을 만들거다. 1 ~ 100 까지 무작위 숫자를 생성하고. 숫자를 입력하면 랜덤 숫자랑 비교해서 숫자가 큰지 작은지 알려줘. 숫자를 맞춘게 몇 회만에 맞췄는지 알려주고 게임을 종.. 2023. 7. 15.