As functions are objects which can have attributes in them, we use one as static value, first initializing it to None. Global variables are considered ugly, though you could use them by using global keyword and this gives kind of "half Object Oriented version" (using objects but not writing classes ourself). Alternative would be to give stroke an extra key parameter which would remember the static value, see http://www.daniweb.com/software-development/python/code/366669
Well, yes, but it's just for learning about pyHook library and things i've never used in Python, such as ftplib, urllib or working with files. Also trying to learn more about classes, I don't care about my friends Facebook ._.
Well, I think it's more a variable error than a pyHook error, but here it is:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pyHook\HookManager.py", line 351, in Keybo
File "C:\Users\MyUser\Desktop\Kaley.py", line 25, in stroke
self.stroke.current_window = event.WindowName
AttributeError: 'instancemethod' object has no attribute 'current_window'
Well it looks like some of the code the error is referring to isn't here, however it could be if event.WindowName != self.stroke.current_window: and before that I don't see self.stroke.current_window defined at all, so it's plausible that there's nothing to check it against so it's throwing the attribute error "because the attribute does not yet exist". Not positive, but it would be the first thing I would check.