import subprocess path_to_notepad = 'C:WindowsSystem32 otepad.exe' path_to_file = 'C:UsersDesktophello.txt' subprocess.call([path_to_notepad, path_to_file])