slash python in path code example
Example: python how to open a file in a different directory in mac
import os
f = open (os.path.expanduser("~/Desktop/somedir/somefile.txt"))
import os
f = open (os.path.expanduser("~/Desktop/somedir/somefile.txt"))