Python - Detect a starting process -


i want detect starting process on windows using python.

for example: whenever user starts notepad.exe want run functions in python.. script should wait process starts.

can gather starting processes using python?

maybe 'os' or 'psutil' module?

hope understand mean.. free ask me more information.

you can kind of hack polling windows system command, tasklist:

import time import subprocess  while true:     p = subprocess.run(['tasklist'], stdout = subprocess.pipe)     if b'notepad.exe' in p.stdout:         print('found!')         break     print('not yet...')     time.sleep(1) 

i'm not aware of way of interrupting startup of process in order run before other process starts.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -