Answer the question
In order to leave comments, you need to log in
How to import all files from a folder?
There is such a structure:
app.py
modules
1.py
2.py 3.py
There
can be any number of files in modules and they can be called by anyone. How to import all files from the modules folder?
And how to import all files in such a structure? (all app.py should be imported):
app.py
modules
1
app.py
2
app.py
3
app.py
Answer the question
In order to leave comments, you need to log in
Well, in general, it is similar to how Django imports migrations: they are generally unidentifiable from python, because the identifier cannot begin with a number. But somehow it works! Conclusion - you need to read the documentation about imports in python.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question