Created
May 18, 2020 23:49
-
-
Save h4ndzdatm0ld/b1eac31019a1c49aa6e128ef244ae912 to your computer and use it in GitHub Desktop.
Save contents to file
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 saveFile(filename, contents): | |
''' Save the contents to a file in the PWD. | |
''' | |
try: | |
f = open(filename, 'w+') | |
f.write(contents) | |
f.close() | |
except Exception as e: | |
print(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment