Message162161
| Author |
javahaxxor |
| Recipients |
hynek, javahaxxor, ronaldoussoren |
| Date |
2012年06月02日.18:13:28 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338660809.5.0.742630608034.issue14985@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
You're right, my code was shite. Strange though it seemed to work on some files. The following updated version does everything as intended with the help of os.path.join:
def traverse (targetDir):
currentDir = targetDir
dirs = os.listdir(targetDir)
for entry in dirs:
if os.path.isdir(os.path.join(currentDir,entry)):
print("Traversing " + os.path.join(targetDir,entry))
traverse(os.path.join(targetDir,entry))
else:
if os.path.isfile(os.path.join(targetDir,entry)):
print("Processing" + " " + os.path.join(currentDir,entry))
else:
print("Not file: " + entry)
print("\n") |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月02日 18:13:29 | javahaxxor | set | recipients:
+ javahaxxor, ronaldoussoren, hynek |
| 2012年06月02日 18:13:29 | javahaxxor | set | messageid: <1338660809.5.0.742630608034.issue14985@psf.upfronthosting.co.za> |
| 2012年06月02日 18:13:28 | javahaxxor | link | issue14985 messages |
| 2012年06月02日 18:13:28 | javahaxxor | create |
|