sohcahto...@gmail.com wrote:
Now, I've noticed people talking about importing os.path.  Is there any
reason to use "import os.path" rather than "import os"?  Both of them will
still put the "os" module into the global namespace.

In the case of os.path it doesn't matter, because the
os module imports the appropriate path module automatically.

But in general, importing a package won't necessarily
import submodules under it, so sometimes you need to
import somepackage.somemodule explicitly.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to