/home/pi/Downloads/words.txt
is Linux/Mac pathC:\Users\hp\Desktop\words.txt
is Windows1. Using raw string to handle back-slash correctly
with open(r"C:\Users\hp\Desktop\words.txt", "rt") as f:or
escaping the back-slash
with open("C:\\Users\\hp\\Desktop\\words.txt", "rt") as f:or
using forward slash
with open("C:/Users/hp/Desktop/words.txt", "rt") as f:
And this was already covered in your first thread on the forum
https://python-forum.io/thread-39705.html
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs