Reputation: 529
I understand that with the glob or listdir modules you can get a list of all the files in a directory. However, I need to know how assign the output from glob or listdir to a variable, in list form, like listdir("/some/file/") = list
and then be able to print list
and see a list of all files in /some/file/
. Please help me out here.
Upvotes: 0
Views: 147
Reputation: 601451
Are you looking for
filelist = os.listdir("/some/path/")
print filelist
If so, consider to work through a Python tutorial :)
Upvotes: 2