Success - Re: Trouble installing PmwContribD - no "PmwContribD.pth"

Russell Whitaker whitaker at best.com
Fri Sep 14 13:42:12 EDT 2001


Gordon McMillan <gmcm at hypernet.com> wrote in message news:<Xns911C4F2D498F5gmcmhypernetcom at 199.171.54.214>...
> Russell Whitaker struggles with .pth files:

I wouldn't call it so much a kampf; more a bit of kaizen.

> 
> > Gordon McMillan <gmcm at hypernet.com> wrote in message
> > news:<Xns911BC0768D0Fgmcmhypernetcom at 199.171.54.214>... 
> 
> [snip]
> 
> >> then a .pth file that says:
> >> D:/mypackages
> >> will make both the spam and andeggs packages available.
> > 
> > 
> > OK, I did that first step, slanting as "\" instead of "/".
> > 
> 
> The only time you need to use backslashes in paths on
> Windows is when they are going directly to a Win32 call
> or being passed to the OS (as in os.system(...)). 
> If it's going to the c runtime library (that is, almost 
> anything you do in regular Python), forward slashes are 
> fine.
> 
> Since backslashes normally[1] need escaping, or the use of a 
> raw string, I heartily advise using forward slashes 
> whenever possible. It will save you from many mysterious bugs.
> 

Good to know the exact details of that; thanks.  I've been
deliberately avoiding, where possible, hardcoding pathname
token separators (e.g. "/", "\", "::"[MacOS pre-BSD]).  

Good example: 
>> os.path.join('dirname', 'filename')

Cheers,
Russell

> [1] Not needed here, because a .pth file is not written
> in Python.
> 
> - Gordon



More information about the Python-list mailing list