I’ve worked with Python for a while, especially on Windows, and honestly, the python r string
has been a lifesaver.
When writing file paths like:
path = r"C:\Users\Name\Documents"
Without the r
, Python treats things like \N
or \U
as special Unicode escapes—this breaks your path.
The r
just tells Python: “Hey, don’t mess with backslashes. Take them as-is.” Simple, but powerful.