On 8/10/19 7:05 AM, Chris Angelico wrote:
On Sat, Aug 10, 2019 at 6:39 PM Paul Moore <p.f.moore@gmail.com> wrote:
There are *many* valid ways to write Windows pathnames in your code:
1. Raw strings 2. Doubling the backslashes 3. Using pathlib (possibly with slash as a directory separator, where it's explicitly noted as a portable option) 4. Using slashes
IMO, using slashes is the *worst* of these. But this latter is a matter of opinion - I've no objection to others believing differently, but I *do* object to slashes being presented as the only option, or the recommended option without qualification. Please expand on why this is the worst?
ChrisA
One big issue with trying to get use to using / on windows for the directory separator is that it doesn't work for many windows programs because on Windows the / character is defined to be the option character (instead of - for *nix) Yes, you can write your program to use the foreign convention of using - for options, and because the system calls accept either \ or / as the directory separator, paths which use the 'wrong' separator will work, but your program will be violating the conventions of the host environment. -- Richard Damon