Jun-02-2021, 02:45 AM
Because backslash is used to start an escape sequence, special characters that don't have a single ascii character (\n for example). To prevent treating the backslash this way you preceed it with a backslash. The functions you called added extra backslashes to retain the backslashes already there. This makes backslash an unfortunate choice as a separator in a file path.
Much confusion can be avoided by using pathlib calls instead of os calls
Much confusion can be avoided by using pathlib calls instead of os calls