these syntaxes can cause name conflicts since they make the imported objects (variablesfunctionsdata typesor modulesdirectly accessible if we want to use the from import syntax to import lots of objectswe can use multiple lines either by escaping each newline except the lastor by enclosing the object names in parenthesesas the third syntax illustrates in the last syntaxthe means "import everything that is not private"which in practical terms means either that every object in the module is imported except for those whose names begin with leading underscoreorif the module has global __all__ variable that holds list of namesthat all the objects named in the __all__ variable are imported here are few import examplesimport os print(os path basename(filename)safe fully qualified access import os path as path print(path basename(filename)risk of name collision with path from os import path print(path basename(filename)risk of name collision with path from os path import basename print(basename(filename)risk of name collision with basename from os path import print(basename(filename)risk of many name collisions the from importable import syntax imports all the objects from the module (or all the modules from the package)--this could be hundreds of names in the case of from os path import *almost names are importedincluding dirnameexistsand splitany of which might be names we would prefer to use for our own variables or functions for exampleif we write from os path import dirnamewe can conveniently call dirname(without qualification but if further on in our code we write dirname "the object reference dirname will now be bound to the string instead of to the dirname(functionso if we try calling dirname(we will get typeerror exception because dirname now refers to string and strings are not callable in view of the potential for name collisions the import syntax createssome programming teams specify in their guidelines that only the import importable syntax may be used howevercertain large packagesparticularly gui (graphical user interfacelibrariesare often imported this way because they have large numbers of functions and classes (custom data typesthat can be tedious to type out by hand question that naturally arises ishow does python know where to look for the modules and packages that are importedthe built-in sys module has __all__