importimports the module into the global namespace. from importimports named elements into the namespace.
So, with a simple one, importyou always need to reference the module:
>>> import datetime
>>> day = datetime.date.today()
But with the help from importyou can directly refer to the elements:
>>> from datetime import date
>>> day = date.today()
from somemodule import *, . , . , , , , , , .
- PYTHONPATH.