import subprocess path_to_notepad = 'C:\\Windows\\System32\\notepad.exe' path_to_file = 'C:\\Users\\Desktop\\hello.txt' subprocess.call([path_to_notepad, path_to_file])