I am trying to understand how to manage the module with I want to be able to import directly I tried to add the line import __all . For example, I have a structured code:
main.py | = & Gt; / Database | = & Gt; __init__.py | = & Gt; Engine (with variable engine, session, etc.) session and engine examples Like the database module:
from the database import session __ All__ = ['Sessions'] or __ all__ = ['engine.session'] to __init__py but when I try to import, one exception to me AttributeError: ' __Ell __ does not list names, by itself, imports items in a module if you database import * to syntax. session If you use the database / __ init__ in , then this is the list name to import from that module .gi :
No comments:
Post a Comment