Possible Duplicate:
how to list all files of a directory in python
How do I list all directory content using python and add it to a list?
With Python, there so many ways to do this however, this one is the simplest i know.
Please check the comments for the specifics of the output.
from os import listdir
list = listdir("C:\Users\Hello\World\Python Programs")
print list #Outputs the whole list
print len(list) #Checks for the length of the list
print list[26] #Outputs a specific element in the list
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With