Say I have the following structure:
main.py
.folder/
a.py
b.py
and using Python 3 and being currently in main.py I want to import * from a.py.
from .folder.a import * is wrong as that ignores that the folder is actually named .folder, not folderfrom ..folder.a import * is wrong as I'm not targeting a relative parent directory called folder, but a folder named .folder within the same directory as main.pyYou can't do this; names of packages and modules need to be valid Python identifiers, which .folder is not. You should rename your directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With