Success - Re: Trouble installing PmwContribD - no "PmwContribD.pth"
Gordon McMillan
gmcm at hypernet.com
Fri Sep 14 07:46:50 EDT 2001
Russell Whitaker struggles with .pth files:
> 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.
[1] Not needed here, because a .pth file is not written
in Python.
- Gordon
More information about the Python-list
mailing list