Skip to content

Instantly share code, notes, and snippets.

@sanand0
Created March 6, 2011 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanand0/857652 to your computer and use it in GitHub Desktop.
Save sanand0/857652 to your computer and use it in GitHub Desktop.
A simple python application that periodically logs the name of the application you're working on.
import win32gui, time, os.path
filename = os.path.join(os.path.dirname(__file__), 'applog.txt')
out = open(filename, 'a')
while True:
title = win32gui.GetWindowText(win32gui.GetForegroundWindow())
out.write(time.strftime('%a %d-%m-%Y %H:%M:%S') + '\t' + title + '\n')
out.flush()
time.sleep(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment