Created
April 24, 2014 16:49
-
-
Save chrisloy/11261449 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def slurp(filename): | |
| return [line.strip() for line in open(filename)] | |
| def green(s): | |
| return '\033[92m' + s + '\033[0m' | |
| def blue(s): | |
| return '\033[94m' + s + '\033[0m' | |
| def red(s): | |
| return '\033[91m' + s + '\033[0m' | |
| def yellow(s): | |
| return '\033[93m' + s + '\033[0m' | |
| def cyan(s): | |
| return '\033[96m' + s + '\033[0m' | |
| def magenta(s): | |
| return '\033[95m' + s + '\033[0m' | |
| def is_number(s): | |
| try: | |
| float(s) | |
| return True | |
| except ValueError: | |
| return False | |
| def average(l): | |
| return reduce(lambda x, y: x + y, l) / len(l) | |
| if __name__ == "__main__": | |
| print "Import me, don't run me!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment