0 votes
by (140 points)
How do I manually import a Python module?

1 Answer

0 votes
by (1.3k points)
The most Pythonic way to import a module from another folder is to place an empty file named __init__.py into that folder and use the relative path with the dot notation. For example, a module in the parent folder would be imported with from .. import module .

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 28, 2019 by fritzing (300 points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 28, 2019 by modules (480 points)
0 votes
1 answer
asked Nov 28, 2019 by module (460 points)
0 votes
1 answer
asked Nov 28, 2019 by degrees (960 points)
0 votes
1 answer
asked May 17, 2021 by brabmodule (120 points)
0 votes
1 answer
asked May 17, 2021 by example (1k points)
...