Message162146
| Author |
hynek |
| Recipients |
hynek, javahaxxor, ronaldoussoren |
| Date |
2012年06月02日.16:01:07 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338652868.6.0.918352108319.issue14985@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think your problem is a different one: os.listdir() doesn't return full paths and os.path.isfile()/isdir() return False if the supplied path doesn't exist.
For example if you have this directory structure:
foo/
foo/bar/
foo/bar/baz
Calling os.listdir('foo') will return ["bar"]. Calling os.isdir('bar') will return False because it can't find the file.
Have a look at os.walk() which was written with your use case in mind. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月02日 16:01:08 | hynek | set | recipients:
+ hynek, ronaldoussoren, javahaxxor |
| 2012年06月02日 16:01:08 | hynek | set | messageid: <1338652868.6.0.918352108319.issue14985@psf.upfronthosting.co.za> |
| 2012年06月02日 16:01:08 | hynek | link | issue14985 messages |
| 2012年06月02日 16:01:07 | hynek | create |
|