0

I am trying to add code after I successfully open a program with a subprocess, but it's not working.

Can anyone tell me why?

    import win32api, win32con
    import subprocess

    subprocess.call(['C:\ProgramData\Microsoft\Windows\Start 
    Menu\Programs\Adobe Premiere Pro 2022.lnk'],shell=True)

    #This code doesn't run after subprocess

    def click(x,y):
        win32api.SetCursorPos((x,y))
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
    click(50,40)
maestro.inc
  • 796
  • 1
  • 6
  • 13
kanjas
  • 73
  • 1
  • 8
  • 2
    Your formatting is screwed up, please fix that. – Sören May 12 '22 at 17:06
  • Thanks for pointing that out. I've done that now. – kanjas May 13 '22 at 06:52
  • 1
    related question, you might find your answer [here](https://stackoverflow.com/questions/21936597/blocking-and-non-blocking-subprocess-calls) (TL;DR: `subprocess.call` is blocking ;)) – NiziL May 13 '22 at 13:05

0 Answers0