I want to open VM player application through python code and I have to import/open VM file but whenever I tried opening the application through subprocess.Popen(self.vmware_path) python code line, it invokes the application at random x,y position.
I have researched some of the possibilities in the subprocess.Popen (STARTUPINOF) but I'm not able to understand the concept of STARTUPINFO class. os.system by this, I could open the application but not able to do it with the predefined position.
# print pyautogui.position()
# print pyautogui.size() # current screen resolution width and height
# pyautogui.PAUSE = 1
# pyautogui.FAILSAFE = True
subprocess.Popen(self.vmware_path)
# si = subprocess.STARTUPINFO()
# si.dwFlags = subprocess.STARTF_USESHOWWINDOW
# si.wShowWindow = 3
Here what I need is,
- I have to open VM player application by pyautogui or any other python module along with below support.
- it should accept predefined window size or
- it should maximize the application to the actual monitor size.