Answer the question
In order to leave comments, you need to log in
How to import all modules from a directory?
For example from here:
import sys
sys.path.append('/module/')
Answer the question
In order to leave comments, you need to log in
Create an __init__.py file in the directory
Mike Evstropov : Python recognizes the folder with this file as a package of modules. You can do this:
import sys
sys.path.append('/module/')
# в папке module есть файл __init__.py и moduleBest.py
# делаем импорт
from module import moduleBest
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question