0
Questions Import in py
What's Different between: 1- from os import * (from any library import *) 2 import os ( import any library) ما الفرق بين: 1- from os import * (from اي مكتبة آخرى import *) 2 import os ( import اي مكتبة آخرى)
2 odpowiedzi
+ 3
the first imports all of the functions, classes and methods into the namespace of the py file. Meaning no need to prefix the call to a function with "<library_name>." you can just call the functions as they are in the namespace. The latter uses the forementioned format. Importing everything from a library into a namespace ia usually frowned upon because it makes things more confusing and it may conflict with another name.
+ 1
Thanks 😊. Slick