T
T
TomasHuk2017-08-22 13:50:24
Python
TomasHuk, 2017-08-22 13:50:24

How to close a third party window in python?

There is a constantly running script that, by key combination through

os.spawnv(os.P_DETACH, pypath, ('python', 'show_help.py', program))

launches a separate window made in pyqt.
Question - how can I close this window using the same key combination (or in any other way)?
There is an option with
os.system('taskkill /fi "WINDOWTITLE eq hot_15_help_window"')

but I don't really like it, as the cmd window appears.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Astrohas, 2017-08-22
@Astrohas

subprocess.Popen(['taskkill', '/fi', "WINDOWTITLE", 'eq', 'hot_15_help_window'], shell=False)

it's about the output in cmd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question