Background
I use the command dir/s in batch files all the time. But, I am unable to call this using python. NOTE: I am
I finally found the answer. To list all directories in a directory (e.g. D:\\, C:\\) on needs to first import the os module.
import os
Then, they need to say that they want to list everything. Within that, they need to make sure that the output is printed.
for top, dirs, files in os.walk('D:\\'):
for nm in files:
print os.path.join(top, nm)
That was how I was able to solve it. Thanks to this.