unabe to import /pyd file.

Steve D'Aprano steve+python at pearwood.info
Fri Dec 15 05:23:33 EST 2017


On Fri, 15 Dec 2017 09:09 pm, Tim Golden wrote:

> Apart from anything else these need to be raw strings:
> 
> sys.path.append(r'C:\Python27\Lib\lib-tk')

Don't use raw strings for paths. It's a trap:


r'C:\Python27'  # okay

r'C:\Python27\'  # fails


Windows supports / as directory separator. You should use / as the directory
separator in your source code, and let the OS convert them to backslashes.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list