Skip to content

Instantly share code, notes, and snippets.

@marten
Created August 24, 2012 09:56
Show Gist options
  • Save marten/3448513 to your computer and use it in GitHub Desktop.
Save marten/3448513 to your computer and use it in GitHub Desktop.
import os
def writefile(name, contents):
directory = os.path.dirname(os.path.realpath(__file__))
filename = os.path.join(directory, "%s.py" % name)
with open(filename, "a") as openfile:
openfile.write(contents)
print 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment