mirror of
https://github.com/python/cpython.git
synced 2025-11-03 15:11:34 +00:00
Unicode howto: use .txt as a more universally understood extension for text files.
This commit is contained in:
parent
a12b682033
commit
e47e184c4a
1 changed files with 1 additions and 1 deletions
|
|
@ -537,7 +537,7 @@ like those in :meth:`str.encode` and :meth:`bytes.decode`.
|
||||||
|
|
||||||
Reading Unicode from a file is therefore simple::
|
Reading Unicode from a file is therefore simple::
|
||||||
|
|
||||||
with open('unicode.rst', encoding='utf-8') as f:
|
with open('unicode.txt', encoding='utf-8') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
print(repr(line))
|
print(repr(line))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue