Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: os.path.isdir do not work for Foder named '2011-07-03' Date: Tue, 19 Jul 2011 14:21:20 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 24 Message-ID: References: <0bf400a3-735c-487a-8d74-feb3b56be99b@g5g2000prn.googlegroups.com> NNTP-Posting-Host: dsl.comtrol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader1.panix.com 1311085280 24910 64.122.56.22 (19 Jul 2011 14:21:20 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Tue, 19 Jul 2011 14:21:20 +0000 (UTC) User-Agent: slrn/pre0.9.9-102 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9883 On 2011-07-19, Nulpum 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 wrong. I'd try using forward slashes if I were you. -- Grant Edwards grant.b.edwards Yow! I'm definitely not at in Omaha! gmail.com