Created
October 13, 2011 22:00
-
-
Save mnem/1285665 to your computer and use it in GitHub Desktop.
Python: Hacking in a new builtin
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
def mnemlog(message): | |
import datetime | |
mnemlog = open("/Users/mnem/mnemlog","a+",0) | |
mnemlog.write(str(datetime.datetime.now()) + " " + message + "\n") | |
mnemlog.close() | |
mod = __import__("__builtin__"); | |
mod.mnemlog = mnemlog | |
mnemlog("It has been done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment