Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list files in directory python with extension

import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
    print(file)
Comment

PREVIOUS NEXT
Code Example
Python :: Python function remove all whitespace from all character columns in dataframe 
Python :: pandas how to get last index 
Python :: use selenium without opening browser 
Python :: drop multiple columns pandas 
Python :: reverse column order pandas 
Python :: get longest shortest word in list python 
Python :: classification report scikit 
Python :: discord.py aliases 
Python :: how do i print the entire array pthon jupyter 
Python :: how to save python list to file 
Python :: pandas add dataframe to the bottom of another 
Python :: python open each file in directory 
Python :: python how move file to directory 
Python :: how to time a python script 
Python :: json file to dict python 
Python :: discord.py make command admin only 
Python :: open image in numpy 
Python :: sklearn plot confusion matrix 
Python :: get website content with beautifulsoup 
Python :: draw a line pygame 
Python :: find table with class beautifulsoup 
Python :: convert seconds to hours python 
Python :: how to make a python exe 
Python :: python roman to integer 
Python :: ignore warning sklearn 
Python :: how to permanently store data in python 
Python :: write dataframe to csv python 
Python :: yield godot 
Python :: count nan pandas 
Python :: pandas group by concat 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =