简体   繁体   中英

I want to open an already opened app in Python

I'm writing a simple program in Python and I need to change windows in which the application works multiple times. I could use pyautogui.click(x, y); to click on the taskbar but thats not efficent enough.

Is there anyway I can do it with a command like: open('appname') or: summon('appname')

Thanks for the help!

you using GUI without Tkinter? very interesting. you need to open program with python script? try:

import os

# If program isnt in a folder with script

os.system("start LETTER:\\Path\\To\\Program")

# If program in a folder with a script or program is a command in command line

os.system("start ProgramName")

With it you can launch any program without limit (if you have a good CPU, GPU and RAM :D)

Welcome to 2022!

You can simply make use of PYPI module AppOpener.

# pip install AppOpener
from AppOpener import run
run("whatsapp") #Opens whatsapp if installed
run("whatsapp, telegram") # Opens whatsapp & telegram

Here, no matters if program is open or not module will open the application .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM