0
Help opening files
Hello everyone, For some reason I'm really struggling with opening files in Python. I have tried examples such as these: 1) With open('Practice/words.txt,) (Both with / and \) 2) With open('words.txt') And other similar examples, but I always receive the error: [Errno 2] No such file or directory: And when I include the full path to the file I receive: (unicode error) 'unicodescape' codec can't decode bytes in position 2-3: Truncated \UIXXXXXXXX escape Sincerely, Adrian
2 odpowiedzi
+ 1
Thank you Jan,
I'll try this the next time I'm at my computer. I think the \\ might be my problem.
Thanks again!
Sincerely,
Adrian
+ 1
Hey Jan,
I couldn't get the file to open from a different directory, but when I move the file to the same location as my script it worked.
I'll try to figure out what's wrong with opening it from a different location some other time since I need to get some more studying done.
Thank you again for your help!
Sincerely,
Adrian