k2104710
k2104710

Reputation: 63

Relative import with Python 3 from folder containing a dot

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.

Upvotes: 6

Views: 2997

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 600041

You can't do this; names of packages and modules need to be valid Python identifiers, which .folder is not. You should rename your directory.

Upvotes: 13

Related Questions