I want to write a python script on Windows that saves the title of the program that the user uses at a given time like the http://www.rescuetime.com . I don't want to use rescuetime because of privacy consideration but instead write a script that does something similar myself to capture data about how much I use my computer.
Is there some easy command that I can use to read that information?
The window in front (foreground) of all other open windows, on a graphical user interface. For example, the Internet browser window you are using to read this web page is considered the active program or active window.
Active glass or window display is the most advanced automobile technology in cars. The devices-based on this technology can be tuned for drivers. For example, turn-on speed and turn by turn directions display when you receive a phone call.
The title bar shows the name of the application, map, or table. If more than one window is open, the title bar of the active window has a color and intensity different from other title bars. The menu bar contains available menus from which you can choose commands.
It might already be too late, but here's what should work on most operating systems:
import pyautogui
window_title = pyautogui.getActiveWindowTitle()
(I'm not sure if it works for Ubuntu, but Mac Os, Linux and Windows are normally supported)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With