Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python loop through all folders and subfolders

directory = "c:folderyouwant	owork_on"

for root, subdirectories, files in os.walk(directory):
    for subdirectory in subdirectories:
        print(os.path.join(root, subdirectory))
    for file in files:
        print(os.path.join(root, file))
Comment

python loop through all folders and subfolders

directory = "c:folderyouwant	owork_on"

for root, subdirectories, files in os.walk(directory):
    for subdirectory in subdirectories:
        print(os.path.join(root, subdirectory))
    for file in files:
        print(os.path.join(root, file))
Comment

PREVIOUS NEXT
Code Example
Python :: pandas rename specific column 
Python :: window size cv2 
Python :: how to capture an image with web cam open cv 
Python :: pycache in gitignore 
Python :: cv2 crop image 
Python :: shutdown/restart windows with python 
Python :: how to loop through dates in python 
Python :: migrate skip in django 
Python :: extended euclidean python 
Python :: cv2.rectangle 
Python :: python list of random values 
Python :: python plot a dictionary 
Python :: convert column to numeric pandas 
Python :: export file csv 
Python :: min max scaler sklearn 
Python :: download pdf from url python 
Python :: python calculate time taken 
Python :: read_csv only certain columns 
Python :: translate sentences in python 
Python :: Write a line to a text file using the write() function 
Python :: clear multiprocessing queue python 
Python :: python count number of zeros in a column 
Python :: discord.py aliases 
Python :: pip code for pytube 
Python :: get date and time in python 
Python :: python bytes to dict 
Python :: discord.py make command admin only 
Python :: how to save a png seaborn pandas 
Python :: normalize values between 0 and 1 python 
Python :: how to open an external file in python 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =