Unicode error - opening *.txt files with python
问题 When I try to read a text file like so in python: x = open("C:\Users\username\Desktop\Hi.txt", 'r') This error is returned: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape I looked around and found this question: "Unicode Error "unicodeescape" codec can't decode bytes... Cannot open text files in Python 3. Apparently I need to duplicate all of the backslashes so Unicode doesn't get all screwed up by what I am trying to do. So