OSError: [Errno 22] Invalid argument: 'D:\x07ckup\test.txt'

使用with open("D:\backup\test.txt","rt") as f:报上面的错误,将上面的语句改成

with open(r"D:\backup\test.txt","rt") as f:

字符串前面加r,表示的意思是禁止字符串转义

posted on 2017-03-14 23:41  黑加仑妞  阅读(1137)  评论(0编辑  收藏  举报