Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python loop through files in directory recursively

import os
rootdir = './path/to/files/'

for subdir, dirs, files in os.walk(rootdir):
    for file in files:
        print os.path.join(subdir, file)
Comment

PREVIOUS NEXT
Code Example
Python :: python check if there is internet 
Python :: pysimplegui double Slider 
Python :: pascal triangle python 
Python :: open image from link python 
Python :: purge command discord.py 
Python :: How to fix snap "pycharm-community" has "install-snap" change in progress 
Python :: python url join 
Python :: get number of missing values dataframe 
Python :: anaconda-navigator command not found 
Python :: geopandas set crs 
Python :: how to plot kmeans graph 
Python :: how to make a python exe 
Python :: install models python 
Python :: how to get ipconfig from python 
Python :: install a specific version of django 
Python :: SSL: CERTIFICATE_VERIFY_FAILED with Python3 
Python :: python current date and time 
Python :: roc curve python 
Python :: python get all folders in directory 
Python :: median of a list python 
Python :: add sheet to existing workbook openpyxl 
Python :: read txt file pandas 
Python :: get video width and height cv2 
Python :: python copy file to another directory 
Python :: exponentiation is the raising of one number to the power of another. this operation is performed using two asterisks **. 
Python :: pandas standard deviation on column 
Python :: create dataframe pyspark 
Python :: debugging pytest in vscode 
Python :: r2 score sklearn 
Python :: proxy selenium python 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =