0

Below is the lines of code

if __name__ == '__main__':
    subprocess.run('"C:/Windows/System32/notepad.exe"')
    print("hiiiiii")

In this case notepad.exe is opened , but print("hiiiiiii) is not executed until i close notepad.exe In my case i want to have the print("hiiiiii") to be executed after notepad.exe is opened

1 Answers1

1

subprocess.run() blocks the main process, Popen() instead

if __name__ == '__main__':
    subprocess.Popen('"C:/Windows/System32/notepad.exe"')
    print("hiiiiii")
Lanbao
  • 666
  • 2
  • 9