Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 20, 2020 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniruddha27/c12a9b985a26cf10075a3e9d68b979fc to your computer and use it in GitHub Desktop.
Save aniruddha27/c12a9b985a26cf10075a3e9d68b979fc to your computer and use it in GitHub Desktop.
import urllib
# function to save image from the passed URL
def download_img(url, i):
# folder = r'C:\Users\Dell\Desktop\Analytics Vidhya\Delhi\\'
folder = r'./Importing files/Delhi/'
# define the file path to store images
filepath = folder + str(i) +'.jpg'
# retrieve the image from the URL and save in the folder
urllib.request.urlretrieve(url,filepath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment