How to check if a directory is exist in python?

Vincent Wehren vincent at visualtrans.de
Sun Mar 19 22:41:24 CET 2006


"Vincent Wehren" <vincent at visualtrans.de> wrote in message 
news:dvkj3a$9vp$1 at news4.tilbu1.nb.home.nl...
| <yinglcs at gmail.com> wrote in message
| news:1142803465.164833.38160 at j33g2000cwa.googlegroups.com...
||I check the documentation here, but it does not say how to check if a
|| directory is exist in python?
|| http://docs.python.org/lib/os-file-dir.html
|
| Look at the exist or isdir  methods of the os.path module

Ofcourse I mean "exists"...

| (http://docs.python.org/lib/module-os.path.html}
|
||
|| And why mkdir fails if the directory already exists?
|
| If you prefer a "more friendly" approach you may wanna take a look at 
Trent
| Mick's _mkdir which is located at
| http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82465
||
|
| Regards,
| Vincent Wehren
|
|| Thank you.
||
|
| 





More information about the Python-list mailing list