This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from Tkinter import * | |
from random import shuffle | |
things = [ | |
'Make some tea', | |
'Do some pushups', | |
'Do some situps', | |
'Go to the bathroom', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if there are any others who don't care much for try ... catch AttributeError | |
def hasmethods(obj, *meth_names): | |
return all( | |
hasattr( | |
# if it calls like a method it's a method | |
getattr(obj, m, None), | |
'__call__' | |
) for m in meth_names | |
) |