I have made a small programming language and seperated the Lexer, Parser, and Interpreter into different files. Now I would like those files to be in a sub directory Source. I have Shell.py that uses them. In short, this is the structure.
Language -{
Source -{
Main.py
Lexer.py
Parser.py
Interpréter.py
Shell.py
In shell .py, I want to import main.py, which in turn imports the Lexer, parser, and interpreter.
So:
#Shell.py
import Source.Main
Main.run(some code)
#Main.py
from Lexer import Lexer
.... Parser
.... Interpreter
When I run Main.py everything works, but when I run Shell.py it comes up with this:
File Source/Main.py, line 1 in <module>
from Lexer import Lexer
ImportError: No module named ‘Lexer’
EDIT: There is an _init_.py in the Source directory. I am not trying to import multiple files from the sub directory, just one that procedes to import others.