August 16th, 2005, 08:05 PM
writing file names into a text file
Is there a way to write a Python scirpt that outputs the names of all the files in a folder to a text file? I know how to manipulate the files individually, but not sure how to get their names. I want something like;
Thanks for your help.
for file in myFolder:
August 16th, 2005, 08:29 PM
You might try something like this:
Originally Posted by sam_kh918
path = raw_input('Directory to search: ')
for file in os.listdir(path):
It is not important if the glass is half full or half empty.What is important,is who has been drinking from MY glass?!?!?
August 16th, 2005, 08:53 PM
Thanks alot, that perfectly does it!
Last edited by sam_kh918; August 16th, 2005 at 09:03 PM.