I am trying to read a file in another directory. My current script is in path/to/dir. However, I want to read a file in ~/. I\'m not sure how to do thi
path/to/dir
~/
use os.path.expanduser:
import os with open(os.path.expanduser('~/.file')) as f: print f.read()