Hi,
I created a text file within the directory where I write my script file.
So when I tries to run the below code, it runs perfectly fine:
Did I made any mistake?
Regards,
Pinaki
I created a text file within the directory where I write my script file.
So when I tries to run the below code, it runs perfectly fine:
print(open("test.txt").read()) and 1Now what I did is created a sub-directory and added another text file. I provided the absolute path to access and run the same above code with updated file path.
print(open("\Output\Hello.txt").read()) and 1However, below error message is displayed:
Error:FileNotFoundError: [Errno 2] No such file or directory: '\\Output\\Hello.txt'
I also try to add mode like read mode and still the same error displayed.Did I made any mistake?
Regards,
Pinaki