os.path.isdir do not work for Foder named '2011-07-03'

Grant Edwards invalid at invalid.invalid
Tue Jul 19 16:21:20 CEST 2011

On 2011-07-19, Nulpum <changjun.cho at gmail.com> wrote:
> I want to make sure that folder exists.
> '2011-07-03' is really exists. but 'os.path.isdir' say false
> Does anyone know why?
>>>> os.path.isdir("C:\Users\??????\Desktop\logs")
> True
>>>> os.path.isdir("C:\Users\??????\Desktop\logs\2011-07-03")
> False

You're not using backslashes corrrectly.   Try assigning the path
names to a "variable" and printing them.  I think you'll see what's

I'd try using forward slashes if I were you.

Grant Edwards               grant.b.edwards        Yow! I'm definitely not
                                  at               in Omaha!

More information about the Python-list mailing list