I'm trying to import and run a module from a parent directory in python interactive mode. My directory looks like this:
modules:
tests:
So, I'm trying to import the modules in the modules
directory while I'm in the test
directory.
This is the what I've tried and the error I'm getting:
>>> new_method = __import__("../0-add_integer.py").add_integer
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named '.'
>>>
However this does not work, please help me out. Thanks in advance.