1,解决办法
"C:\\Users\\Darkness-02\\Desktop\\test.txt"
多加一个反斜杠就行了
2,解决办法
r"C:\Users\Darkness-02\Desktop\txt.txt"
变为字符串
玩具
with open("C:\\Users\\Darkness-02\\Desktop\\test.txt","r") as txt:
print(txt.read())
with open(r"C:\Users\Darkness-02\Desktop\txt.txt","r") as txt:
print(txt.read())