Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python list subdirectories

os.walk(directory)
[x[0] for x in os.walk(directory)]
Comment

List all subdirectories in a directory in Python

import os
 
rootdir = 'path/to/dir'
for file in os.listdir(rootdir):
    d = os.path.join(rootdir, file)
    if os.path.isdir(d):
        print(d)
Comment

PREVIOUS NEXT
Code Example
Python :: error bar plot python 
Python :: dot product python 
Python :: pandas correlation 
Python :: rename a column in python 
Python :: how to make a button circular in python 
Python :: how to add up everything in a list python 
Python :: pandas dataframe macd 
Python :: python previous answer 
Python :: how to iterate pandas dataframe 
Python :: python version check 
Python :: how to print a float with only 2 digits after decimal in python 
Python :: add time delta pytohn 
Python :: django models distinct 
Python :: sort by dataframe 
Python :: find duplicate in dataset python 
Python :: python delete key from dict 
Python :: how to log ip addresses in python 
Python :: set text and background color in pandas table 
Python :: replace error with nan pandas 
Python :: python virus 
Python :: remove duplicates from list python 
Python :: openpyxl add worksheet 
Python :: pandas repeat rows n times 
Python :: how to find the cube of a number in python 
Python :: python module with alphabet list 
Python :: django filter text first character upper case 
Python :: get first element of ordereddict 
Python :: zlib decompress python 
Python :: python diamond 
Python :: python get random character from string 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =