Some more notes

Peter Hansen peter at engcorp.com
Sat Oct 23 10:01:00 EDT 2004


bearophile wrote:
> Cliff Wells:
>>Why not just use "/"?
> 
> Okay, I'll use os.path.normcase to convert them.

That's not necessary in almost all cases.  Windows happily(*)
accepts forward slashes in all system calls.  The only place
it does not is in the *shell* (aka command.com and cmd.exe).
That means paths passed as arguments to os.system or the
Popen gang need to be normcased, but for things like open()
you don't need to bother.

-Peter

(*) There are theories that although Windows does accept
forward slashes, it does so only grudgingly.



More information about the Python-list mailing list