[Tutor] absolute locations

Blake Winton bwinton at latte.ca
Thu Jan 8 17:34:53 EST 2004


> >>>> fileName = os.path.join("c:", "Documents and
> >Settings", "Christopher Spears", "My Documents",
> >"python", "unit4.txt")
> 
> Look at the *right* way to do it:
> 
> >>> fileName = os.path.join("c:\\Documents and Settings", 
> "Christopher Spears", "My Documents", "python", "unit4.txt")

Well, that's a way that works, but I, for one, am not
completely convinced that the first way shouldn't work.
Why should someone be forced to type the first "\\",
especially since that might change on a per-os basis?

Later,
Blake.




More information about the Tutor mailing list