본문 바로가기

python7

[MCP] Python으로 날씨 챗봇 만들기 🤖 나만의 AI 비서 만들기: Python과 FastMCP로 날씨 챗봇 도구 제작기최근 ChatGPT 같은 대화형 AI 모델이 정말 똑똑해졌죠? 하지만 AI가 모든 것을 아는 건 아닙니다. 특히 "오늘 서울 날씨 어때?"와 같은 실시간 정보나 특정 데이터베이스에 접근해야 하는 질문에는 바로 대답하기 어렵습니다.이때 필요한 것이 바로 "도구(Tool)"입니다. AI가 스스로 할 수 없는 일을 대신 처리해 주는 외부 기능이죠. 오늘은 Python의 FastMCP와 requests 라이브러리를 사용해, 특정 위치의 현재 날씨를 알려주는 간단한 도구를 만들고 서버를 구축하는 과정을 보여드리겠습니다.✨ 완성된 코드 미리보기먼저 우리가 만들 전체 코드입니다. 한눈에 봐도 무척 간단하죠?Python from mcp.. 2025. 7. 10.
[python] Covid19 정보조회 지난 포스팅에서 Golang으로 #Covid19 각국의 감염정보를 조회하는 방법을 알아봤다https://xwing.tistory.com/169이번엔 같은 정보를 파이썬으로 만들어 보겠다.import pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport requestsimport jsonr = requests.get('https://api.covid19api.com/dayone/country/korea-south/status/confirmed', stream=False)html = r.textitems = json.loads(html)df = pd.DataFrame(items)#print (df)df.to_excel (r'Covid19(S.. 2021. 1. 28.
[python] pyinstaller using pyinstaller install pip install pyinstaller site https://pyinstaller.readthedocs.io/en/stable/usage.html Using PyInstaller — PyInstaller 4.2 documentation Making GNU/Linux Apps Forward-Compatible Under GNU/Linux, PyInstaller does not bundle libc (the C standard library, usually glibc, the Gnu version) with the app. Instead, the app expects to link dynamically to the libc from the local OS .. 2021. 1. 17.
[python 기초] 엑셀에 달력출력하기 Python 과 openpyxl 을 이용해서 달력을 엑셀에 출력해 봅시다 # 달력 출력하기 from openpyxl import styles from openpyxl.styles.borders import Border, Side from openpyxl.styles import Font, Color, Alignment from openpyxl import Workbook import openpyxl import calendar import datetime BORDER_NONE = None BORDER_DASHDOT = 'dashDot' BORDER_DASHDOTDOT = 'dashDotDot' BORDER_DASHED = 'dashed' BORDER_DOTTED = 'dotted' BORDER_DOUBL.. 2021. 1. 7.
[python 기초] 엑셀에 구구단 출력하기 Python 과 python 모듈 openpyxl 을 이용해서 엑셀에 구구단을 출력해 봅시다. openpyxl 설치 site : openpyxl.readthedocs.io/en/stable/index.html openpyxl - A Python library to read/write Excel 2010 xlsx/xlsm files — openpyxl 3.0.5 documentation Install openpyxl using pip. It is advisable to do this in a Python virtualenv without system packages: Warning To be able to include images (jpeg, png, bmp,…) into an openpyxl file,.. 2021. 1. 5.
yahoo finance 크롤링 야후 파이낸스에서 일봉정보를 크롤링해 봅시다. GIST 가기 ya_fi.py GitHub Gist: instantly share code, notes, and snippets. gist.github.com import requests import datetime as pydatetime import time import datetime import json url = "https://apidojo-yahoo-finance-v1.p.rapidapi.com/stock/v2/get-historical-data" toDate = datetime.date.today() fromDate = toDate - datetime.timedelta(days=10) # print (fromDate.__format__("%Y-.. 2020. 12. 19.