+ 3
python files
I have file called deposit in Mac book pro. I want to open in read mode using its full location but it didn't work for me: deposit is in icloudrive/desktop/deposit.txt
2 Answers
+ 10
import os
dir = os.path.dirname(__file__)
rel_path ="deposit"
abs_file = os.path.join(dir, rel_path)
where __file__ full path to directory with file
+ 3
Thank you :)