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
#!/usr/bin/python2 | |
''' | |
SYNOPSIS: | |
$ python speedup.py -f FILE | |
or | |
$ python speedup.py -d DIR | |
''' |
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
import datetime | |
# 2012-12-15 10:14:51.898000 | |
print datetime.datetime.utcnow() | |
# The now differs from utcnow as expected | |
# otherwise they work the same way: | |
# 2012-12-15 11:15:09.205000 | |
print datetime.datetime.now() |
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
#!/usr/bin/python | |
# Filename: raising.py | |
class ShortInputException(Exception): | |
'''A user-defined exception class.''' | |
def __init__(self, length, atleast): | |
Exception.__init__(self) | |
self.length = length | |
self.atleast = atleast | |
try: |