I see many people use the following import methods in their projects:
from .module1 import a,b
from ..module2 import *
The module1 and module2 are a .py
file but not a folder for package. What's the differences to the import module
? Does it mean to import the module in current and ../ folder? But when I try to import another file in same folder, it said:
import .other
>>> SyntaxError: Invalid syntax
from .other import *
>>> ValueError: Attempted relative import in non-package
I'm curious on it. Thanks~