I am searching for the best-known library to use/implement a listener over the system applications in Python

For example,

  1. print "This is a new application" whenever a new application (notepad let's say) starts [Event]
  2. print "appicationX is closed" whenever a running application (notepad let's say) closed [Event]
  3. I want to print "User is now focused on AppX" whenever the user jump from one application to another (jumped from notepad to chrome) [Event]

Through my search, I found this Python code which makes use of the ctypes library to do something similar to what I am searching for

It has two problems

  1. it works on windows only
  2. it doesn't capture on-open / on-close events -- it just captures the on-change events

I am looking for a library to use that can overcome those two

  • You forgot to mention what platforms you need in addition to Windows. But as the available UI systems work all totally different I don't think there is a real solution because each platform needs different code...
    – Robert
    Nov 7, 2022 at 22:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.