How to query running applications in windows through python?

Asked

Viewed 20 times

-2

my application is to create a program in python that identifies the software x or y is open on the operating system, or that returns me a list of software running on the operating system. I tried some solutions by searching for a list of processes but without success. Someone can help me?

The idea is that I then develop something like, "If the X program is open, do this. If the Y program is open, do something else."

1 answer

0

import psutil import json

outlook = json.dumps({"name": "OUTLOOK.EXE"})

for proc in psutil.process_iter(['name']): #print(proc.info) input = json.dumps(proc.info) if input=outlook: print('Outlook opened'')

Browser other questions tagged

You are not signed in. Login or sign up in order to post.