import os # Look to the path of your current working directory working_directory = os.getcwd() # Or: file_path = os.path.join(working_directory, 'my_file.py') file_path = working_directory + 'my_file.py'