This URL has a good section on raw strings.
r'\' is wrong because raw strings were originally added to make
regular expressions easier to write. And you can't have a regexp that
ends with \.
Also, you can use the \ to escape your original quote character.
"I can\\'t end strings with a \\'"