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
Question about downloading files and images from web
Post a Reply
|Oldest Newest Rating|
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 urllib.request.name 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 “_”)
This section is all about snakes! Just kidding.
|Bucky Roberts Administrator|