I have the following folder structure:
In this process_file.py script I want to be able to import the class process_things.py which is in the classes folder. Tried following method 3 in this blog but it doesn't seem to work:
https://blog.finxter.com/python-how-to-import-modules-from-another-folder/
I have noticed that if I put the process_file.py file outside the jobs folder and run from classes import process_file then it works fine, but ideally I really want the file to be in the jobs folder.
1 Answer 1
did you check sys lib? a quick way like this :
import sys
sys.path.append('/path_to_your_project_folder/src/databricks/classes')
import process_things
Sign up to request clarification or add additional context in comments.
1 Comment
tommyhmt
yeah that works but I want to stick to method 3 if possible
lang-py