June 14th, 2004, 01:01 PM
My brain seems to not be working today, so I thought I would ask for a little help. I have this program that searches for folders with certain names, but a problem occured when it found an xls document with the same name as the folders it was looking for. I realize I could just rename the xls document, but I would rather have the code omit files. Is there a way to do this, or have it so it only looks at folders and not files?
June 14th, 2004, 01:09 PM
There are functions in the os module to help make those decisions. That assumes it is Python you are talking about.
June 14th, 2004, 01:14 PM
Yes, it is Python. Sorry I didnt mention (remember brain not working comment? haha) I am a pure newbie so, I'm trying to figure out what you mean by "in the os module"...
Originally Posted by Grim Archon
June 14th, 2004, 01:17 PM
The functions i think Grim was getting at is called os.path.isdir() which you can find in the os.path documentation - along with some others which you can also use to check if the path is this or that.
Just because your brain isn't working today here it is .
Hope this helps,
June 14th, 2004, 01:23 PM
Thanks alot guys, it works!
June 14th, 2004, 01:28 PM
No problem at all. You might also want to take a few seconds to look over the stick at the top of this forum conserning how to ask a question .