Y
Y
Yura Milevsky2021-03-22 10:44:40
Python
Yura Milevsky, 2021-03-22 10:44:40

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

1 answer(s)
C
comradeRecky, 2021-03-22
@comradeRecky

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 question

Ask a Question

731 491 924 answers to any question