file paths python code example
Example 1: python open file relative to module
import os
TEST_FILENAME = os.path.join(os.path.dirname(__file__), 'test.txt')
Example 2: python file from path
import os
dir_path = os.path.dirname(os.path.realpath(__file__))