Unicode error when opening a file in Python 3
<p>I have been having a horrible time just trying to open a file in python 3 because of the "\U" in the "C:\Users..." microsoft path name. I'm getting the error "SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes..."</p>

<p>I've read the other answers to this problem that offer the following solutions:</p>

<ol>
<li><p>Double the \ to escape the unicode of the "\U"</p></li>
<li><p>Use a raw string filename = r"C:\Users.."</p></li>
<li><p>Switch the \ to /.</p></li>
</ol>

<p>Whenever I use option 1 and/or 2 it doubles the "\". So, the filepath is wrong because it reads 'C:\\Users\\..." instead of 'C:\Users\...'</p>

<p>I'm trying to open excel files at work to manipulate data, and so option 3 isn't available to me, as I can't change the filepath.</p>

<p>Can someone explain why the "\" are doubling when I use the escape "\" or a raw string?</p>

<p>I've tried every combination of options and can't seem to get this to work.</p>

<p>Sorry for making a new question to an already answered problem, but I couldn't comment on the other answers, and the accepted answers weren't working for me.</p>

<p>Thanks</p>