I am making a flask web app and I have something I don't understand.
My app
module folder structure goes like this :
app\
| static\
| templates\
| tmp\
| __init__.py
| run.py <= debug script
| toolxls.py <= helper functions
| views.py
in my init.py :
from flask import Flask
app = Flask(__name__)
from app import views
now if I import app module from IDLE:
>>> import app
>>> dir(app)
['Flask', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'app', 'views']
module app
has no toolxls
sub-module. How can I add toolxls.py into app
?
In Python, submodules are not imported when you import the package. You must import them explicitly if you want access to their namespace.