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