Skip to content

Instantly share code, notes, and snippets.

@ged1959
Created January 13, 2017 04:19
Show Gist options
  • Save ged1959/fa690c0eb5aeca09e0d1c602b5b0826f to your computer and use it in GitHub Desktop.
Save ged1959/fa690c0eb5aeca09e0d1c602b5b0826f to your computer and use it in GitHub Desktop.
fileread.py
# coding: utf-8
file = open('test.txt', 'r', encoding='utf-8')
whole_str = file.read()
file.close()
print(whole_str)
'''
最初、「ascii decoding error」が発生。
以下を参考に解決!
http://stackoverflow.com/questions/37083687/unicodedecodeerror-ascii-codec-cant-decode-byte-0x92
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment