Hello all,
I have a Folder with subfolders:
How can i get the names subfolder with python?
Thanks in Advance,
Hello all,
I have a Folder with subfolders:
How can i get the names subfolder with python?
Thanks in Advance,
Best answer by takashi
An example.
>>> import os
>>> root = 'C:/Data'
>>> for file in os.listdir(root):
... if os.path.isdir('%s/%s' % (root, file)):
... print file
"os.walk" can also be used. See also the Python documentation.
BTW, why not use the PATH reader?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.