Skip to content

Instantly share code, notes, and snippets.

@guestl
Created February 23, 2017 15:24
Show Gist options
  • Save guestl/099aeeae96c2b3533972084154e20ea1 to your computer and use it in GitHub Desktop.
Save guestl/099aeeae96c2b3533972084154e20ea1 to your computer and use it in GitHub Desktop.
open file for writing From https://greppage.com/tejal29/26
with open('workfile', 'w') as f:
f.write("Override existing file if exists or create new")
with open('workfile', 'a') as f:
f.write("append to existsing file if exists or create new")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment