"6:{}".format(u"\u4e2d"); It is also important to specify the encoding of files when reading and writing non-ASCII encodings, otherwise you will have garbled characters. For UTF-8 it is also usually better to include a byte order mark as well. The following code opens files for read...
I dislike it when we summarize our posts and articles with a "tl;dr". There's a perfectly good English word for it, namely "summary". "tl;dr", besides being an ugly internetism, seems to me to convey a certain additional meaning, over the neutral "summary". If, as happens on the...