io_unicode.py 194 B

12345678910
  1. # encoding=utf-8
  2. import io
  3. f = io.open("abc.txt", "wt", encoding="utf-8")
  4. f.write(u"Imagine non-English language here")
  5. f.close()
  6. text = io.open("abc.txt", encoding="utf-8").read()
  7. print text