<div dir="ltr"><div><div><div><div><div><div>Hi all, <br><br></div>I have been working on some Flask projects, and was trying to do some Dyanic importing for the Blueprint Modules. I didn't like all the import statements. . . <br>
<br></div>blueprints = ['frontend', 'admin']<br></div>for path in blueprints:<br></div>    mod = __import__('controllers.%s' % path, fromlist=[path])<br></div>    app.register_blueprint(mod)<br><br>
</div>I also initial tried os.walk and using exec 'import statement'. but didn;t feel right. Has anyone else done something similar to this?<br><div><div><div><div><div><div><div><div><div><div><div>-- <br>This electronic message is intended to be for the use only of the named recipient, and may contain information that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately by contacting the sender at the electronic mail address noted above, and delete and destroy all copies of this message.  Thank you.
</div></div></div></div></div></div></div></div></div></div></div></div>