Mar-03-2018, 01:12 PM
Hi, all.
I have a problem to import personals modules.
My folder:
I execute just the script 'test.py', by IDLE, or by run into terminal.
This script call the module 'config.py' without any problem... as:
Really, i dont understand!?
I have a problem to import personals modules.
My folder:
Quote:test.py
/modules/__init__.py
/modules/config.py
/modules/notification.py
I execute just the script 'test.py', by IDLE, or by run into terminal.
This script call the module 'config.py' without any problem... as:
from modules.config import Configthe 'config.py' need module 'notification.py', and i wrote the code as:
try:
from modules.notification import Info
except ImportError:
print(f'Cant import notification module onto Config')
sys.exit(1)Result the error: Error:Cant import notification module onto ConfigI tested with: from modules import notificationor, by using:
from __future__ import absolute_import
try:
from . import notification
except ImportError:or from .modules import notificationSame problem!
Really, i dont understand!?
