DEV Community

Nilotpal Choudhury
Nilotpal Choudhury

Posted on

Answer: How to import python file located in same subdirectory in a pycharm project

If you don't have an __init__.py create one and add this line

from util.util import my_function

then you can easily import the module in your scripts the __init__.py tells python that it should treat that folder as a python package, it can also be used to import/load modules too.

in…

Top comments (0)