Had to post this question again as my previous one was closed saying that my question wasn't focused. So here by I'm trying again.
My Folder structure looks like this:
root_folder:
- core
- files
- solution
- sub_folder
- test.py
- tests
I need to get the absolute path of sub folder files from the python file test.py.
Have tried various ways using os.path.abs and os.path.dirname but did not work for me.
Any help could be appreciated.
Tested code and output:
print(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'files'))
output: /home/kulasangar/Documents/bst_work/root_folder/solution/files
expected output:
/home/kulasangar/Documents/bst_work/root_folder/files