f = open(r"C:\Users\12570\Desktop\小问题.txt", "r")
str = f.read()
print(str)
f.close()
加入编码格式
f = open(r"C:\Users\12570\Desktop\小问题.txt", "r", encoding="utf-8")
str = f.read()
print(str)
f.close()
done
f = open(r"C:\Users\12570\Desktop\小问题.txt", "r")
str = f.read()
print(str)
f.close()
加入编码格式
f = open(r"C:\Users\12570\Desktop\小问题.txt", "r", encoding="utf-8")
str = f.read()
print(str)
f.close()
done