python 6

[python] Covid19 정보조회

지난 포스팅에서 Golang으로 #Covid19 각국의 감염정보를 조회하는 방법을 알아봤다 https://xwing.tistory.com/169 이번엔 같은 정보를 파이썬으로 만들어 보겠다. import pandas as pd import numpy as np import matplotlib.pyplot as plt import requests import json r = requests.get('https://api.covid19api.com/dayone/country/korea-south/status/confirmed', stream=False) html = r.text items = json.loads(html) df = pd.DataFrame(items) #print (df) df.to_excel..

개발/python 2021.01.28

[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..

개발/python 2021.01.07

[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,..

개발/python 2021.01.05

python - 다음 일봉 크롤링

파이썬으로 다음사이트에서 일봉을 크롤링해와 봅시다~~ # 다음 금융 일봉 크롤링 import requests from bs4 import BeautifulSoup import json url = 'https://finance.daum.net/api/charts/A066570/days?limit=200&adjusted=true' headers = { "referer": "https://finance.daum.net/chart/A005930", "user-agent": "Mozilla/5.0" } params = { "limit": "200", "adjusted": "true" } r = requests.get(url, headers=headers, params=params) szContent = r.tex..

개발/python 2020.12.19