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 ::  
Python :: run django app locally 
Python :: jupyter notebook dark theme 
Python :: display Max rows in a pandas dataframe 
Python ::  
Python :: each line in a text file into a list in Python 
Python ::  
Python ::  
::  
Python :: frequency count of values in pandas dataframe 
Python :: STandardScaler use example 
Python :: How do I set Conda to activate the base environment by default? 
:: tkinter how to disable window resizing 
Python ::  
:: pandas series values into strings 
Python :: how to append to text file with new line by line in python 
:: code for showing contents of a file and printing it in python 
Python ::  
::  
:: discord.py dm specific user 
::  
:: np array to df 
Python :: cors error in flask 
::  
::  
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
1+4 =