Created
June 29, 2010 17:47
-
-
Save swanson/457539 to your computer and use it in GitHub Desktop.
The cat ate my source code...
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
import os | |
class Cat(object): | |
"""Any variety of feline""" | |
def eat(self, food): | |
os.remove(food) | |
print "Meow" | |
with open('my_src.py', 'w') as fp: | |
fp.write("print 'hello world!'") | |
the_cat = Cat() | |
the_cat.eat(os.path.join(os.getcwd(), "my_src.py")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment