On Sat, 11 Feb 2017 05:11 am, epro...@gmail.com wrote:

> Hello NG
> 
> Python 3.5.2
> 
> Windows 10
> 
> os.path.isfile() no recognise file with double dot?
> 
> eg. match.cpython-35.pyc



I doubt that very much. I expect you are probably writing something like
this:


path = 'My Documents\testing\path\match.cpython-35.pyc'
os.path.isfile(path)

and not realising that you have a TAB character in your string from the \t,
or something similar.

In Python, you should always use forward slashes for paths, even on Windows.

path = 'My Documents/testing/path/match.cpython-35.pyc'

Try printing the repr() of your path.





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

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to