Question about downloading files and images from web

0 aakarsh saxena · August 7, 2015
are these two statements equivalent?
1. import urllib.request
2. from urllib import request

if yes then why does 1st one does not work for downloading files and the second doest not work in downloading images?
if no then what is the difference and when to use which one

Post a Reply


Oldest  Newest  Rating
0 Bernard Pyc0d333 Parah · August 8, 2015
This is the same thing you are doing...I can't really figure out any problem if you don't drop the codes you used.

Note that these are 2 different methods of  importing modules. These two methods import the same module.

The first method creates a reference to that module in the current namespace. This means that after you’ve run this statement, you can use to refer to things defined in module urllib.request

The second method creates references in the current namespace to all public objects defined by that urllib(that is, everything that doesn’t have a name starting with “_”)
  • 1



This section is all about snakes! Just kidding.

Bucky Roberts Administrator