文件内容
a、yesterday
Oh, yesterday when I was young噢 昨日当我年少轻狂So many, many songs were waiting to be sung有那么那么多甜美的曲儿等我歌唱So many wild pleasures lay in store for me有那么多肆意的快乐等我享受And so much pain my eyes refused to see还有那么多痛苦 我的双眼却视而不见There are so many songs in me that won't be sung我有太多歌曲永远不会被唱起I feel the bitter taste of tears upon my tongue我尝到了舌尖泪水的苦涩滋味The time has come for me to pay for yesterday终于到了付出代价的时间 为了昨日When I was young当我年少轻狂
b、打开文件
如果不使用encoding="utf-8",系统默认使用Windows的字符编码gbk打开。
而python的编码使用的是utf-8来打开文件。
data = open("yesterday