본문 바로가기

ChatGPT10

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 이용한 프로그램 짜기 3 - 파이썬(텍스트 음성변환) ✔ gpt 요청 : Python을 사용하여 한글 텍스트를 한글 음성으로 변환하는 코드를 작성한다. API가 아닌 무료로 제공되는 라이브러리를 이용해줘 import pyttsx3 def convert_text_to_speech(text, output_file): engine = pyttsx3.init() engine.save_to_file(text, output_file) engine.runAndWait() text = "안녕하세요. 반갑습니다." output_file = "output.wav" convert_text_to_speech(text, output_file) ✔ gpt요청 : Python에서 gtts를 사용하여 한국어 텍스트를 음성으로 변환하는 예제 코드 작성해줘 from gtts import .. 2023. 7. 17.