Skip to content

Instantly share code, notes, and snippets.

@guori12321
Created October 15, 2013 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guori12321/6985576 to your computer and use it in GitHub Desktop.
Save guori12321/6985576 to your computer and use it in GitHub Desktop.
how to read utf-8 file with python
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
readFile = open('test.txt', 'r')
print readFile.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment