If you're a software developer, you're often asked to include in your daily report what work you've done and how many minutes you've done. Even if you say that, it is difficult to keep a record when you are busy, so I made a script to do that on the premise that "If you keep a record of the active window, you can understand what you were doing." It was. There are likely to be other people who would be happy to use it, so I will publish it. If you're a programmer using an editor that shows the name of the file you're editing in the title bar, you can look back at what you were doing with this script later.
Below: https://github.com/aikige/homeBinWin/blob/master/dumpForegroundWindow.py
win32gui.GetForegroundWindow
and win32gui.GetWindowText
included in pywin32 to get the title of the Window currently running on Foreground. To do.If you don't have pywin32 yet, please install it.
pip install pywin32
Python 3.8.1
pywin32 Version 227
Recommended Posts