On Tue, Nov 6, 2012 at 4:19 PM, iMath <redstone-c...@163.com> wrote: > How to only get a list of the names of the non-directory files in current > directory ('.')? > (Note excluding its subdirectories ). > > I need the code : )
Start by getting a list of names of everything in the current directory. Then filter that list by testing each one to see if it's a directory. Tip: The second step can be done with os.path.isdir Put some code together and try it. If you have trouble, post your code, any exception traceback you get, and what you're having difficulty with, and we'll go on from there. Have fun! ChrisA -- http://mail.python.org/mailman/listinfo/python-list