Python 웹에서 파일 다운로드

Jmnote (토론 | 기여)님의 2021년 7월 13일 (화) 02:31 판 (→‎개요)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

Python 웹에서 파일 다운로드
# 다운로드
import requests
url = 'https://raw.githubusercontent.com/django/django/main/README.rst'
r = requests.get(url, allow_redirects=True)
open('README.rst', 'wb').write(r.content)

# 내용 확인
f = open('README.rst', 'r')
print(f.read())

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}