Answer the question
In order to leave comments, you need to log in
How to expand (maximize the window of already opened) applications using Python?
I want to use the voice assistant to open applications (already done) OR expand the windows of already open applications. That is, check whether the application is running and then perform the desired action. How can I do it? I have already figured out the launch of applications, the only question is checking for neglect, and deployment.
Answer the question
In order to leave comments, you need to log in
As an option:
import pygetwindow as gw
try:
win = gw.getWindowsWithTitle('cmd')[0]
win.maximize() # Можете не использовать, если нет необходимости.
win.activate()
except IndexError:
print('no such window')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question