Skip to content

Instantly share code, notes, and snippets.

@neilkod
Created December 28, 2011 20:51
Show Gist options
  • Save neilkod/1529672 to your computer and use it in GitHub Desktop.
Save neilkod/1529672 to your computer and use it in GitHub Desktop.
write unicode to a file
import codecs
def writeToLogUnicode(logFile,text):
fileHandle = codecs.open(logFile,'a','utf-8')
fileHandle.write(text + '\n')
fileHandle.close()
writeToLogUnicode('foo.log', 'unicode text goes here')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment