plik otwartego Pythona w stosunku do modułu
import os
TEST_FILENAME = os.path.join(os.path.dirname(__file__), 'test.txt')
Good Goshawk
import os
TEST_FILENAME = os.path.join(os.path.dirname(__file__), 'test.txt')
import os
dirname = os.path.dirname(__file__)
filename = os.path.join(dirname, 'relative/path/to/file/you/want')
import sys,os
sys.path.append(os.path.realpath('..'))