Skip to content

Instantly share code, notes, and snippets.

@swanson
Created June 29, 2010 17:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swanson/457539 to your computer and use it in GitHub Desktop.
Save swanson/457539 to your computer and use it in GitHub Desktop.
The cat ate my source code...
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