Python 웹에서 파일 다운로드

Jmnote (토론 | 기여)님의 2021년 7월 13일 (화) 02:29 판 (→‎개요)

1 개요

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

# 내용 확인
f = open('pyproject.toml', "r")
print(f.read())

2 같이 보기

3 참고

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