how to fix this error?:( | SoloLearn: Learn to code for FREE!


how to fix this error?:(

x = open("D:\asd.txt") Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> x = open("D:\asd.txt") OSError: [Errno 22] Invalid argument: 'D:\x07sd.txt'

7/2/2020 12:55:28 PM

sandro letodiani

1 Answer

New Answer


Try with raw string r"D:\asd.txt" or use escape sequence "D:\\asd.txt"