2014-07-14 6 views
-2

인터넷에서 .jpg 파일을 다운로드하고 싶습니다. 파이썬 콘솔에서 파일을 다운로드 할 수있는 기능을 알고 싶습니다. 그래서 나는 방법은 그런 식으로 더 많거나 적은 것입니다 가정 :Python : 인터넷을 통해 이미지를 다운로드하는 방법 URL

pythondonwloadfunction(URLofthefile, rootwheresavethedonwloadedfile) 
+0

중복 가능성 [? 내가 사용 HTTP를 통해 파일을 다운로드하려면 어떻게 파이썬 (http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python) – sebastian

답변

0
import requests 
with open('img.jpg', 'wb') as f: 
    f.write(requests.get('<image_url>').content) 
관련 문제