Let's say I have a python package called my project. Inside this directory, I have two other directories named run_files and code_files. So the file structure is as follows:
->my project
|
|___________
| ->run_files
| |
| |_________run.py
|
|___________
-> code_files
|
|_________codes.py
As the names suggests run_files contains the python file (like run.py) where I am going to execute my python program while code_files contains other files (like code.py) where the main codes of my program exist. Clearly, I need to import some of the files inside the code_files directory to run my program.
However, the problem is that because of this structure I get import error since when python wants to run it, it looks into the parent directory and tries to find the files with root run_files. How can I change this with a code inside my python file run.py instead of resorting to changing it on terminal.
my project, and have it import code you need fromrun_files. Your actual script may be no more thanimport run_files; run_files.run.go(), whererun.gois just your script-level code wrapped in a function to serve as an entry point.-e(editable)?