python - os.path.isfile() returns false for existing Windows file -


for reason os.path.isfile() returns false existing windows files. @ first, assumed spaces in filename causing problem, other file paths spaces worked fine. here's copy python console illustrates issue:

>>> import os >>> os.path.isfile("c:\program files\internet explorer\images\bing.ico") false >>> os.path.isfile("c:\program files\internet explorer\images\pinnedsitelogo.contrast-black_scale-80.png") true 

how can fix problem?

\b in string means backspace. if want actual backslashes in string, need escaped more backslashes (\\ instead of \), or need use raw string (r"..." instead of "..."). file paths, i'd recommend using forward slashes.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -