What's the difference between from. An import b and from An import b?

from. What"s the difference between An import b and from An import b? What does this .A dot mean by
? I thought about it. A should there be a bag name in front of it?

Apr.21,2022

.A means to import b from package An in the current directory, which is a relative path. While An imports b from package A, package An is not necessarily in the current directory and is an absolute path.


from'. / A' means that A
from'B' in this directory of the current files will first look for this B in the node_modules folder


from .An import b : find A

from dirname (_ file__)

from An import b : find A

from sys.path .
Menu