Not downloading the image from internet

0 Shams Hassan · April 6, 2015
import random
import urllib.request

def download_web_image(url):
name = random.randrange(1, 1000)
full_name = str(name) + ".jpg"
urllib.request.urlretrieve(full_name)

download_web_image('https://encrypted-tbn3.gstatic.com/imagesq=tbn:ANd9GcT3lGEbpTNaxNvsXBaMaI_NXVxBrT2JSPVlKcI7jeXhQbvdFHPxYA.jpg')

Post a Reply

Replies

Oldest  Newest  Rating
0 abdullah abadilah · April 11, 2015
the Requests modules is not installing in my Pycharm. whats the solution pls?
  • 1

Python

107,160 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator