Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python select file in folder given extension

# use endswith(".extension")

import os
for file in os.listdir("/mydir"):
    if file.endswith(".txt"):
        print(os.path.join("/mydir", file))
Comment

PREVIOUS NEXT
Code Example
Python :: how to keep track of your sport running times in python 
Python :: # read table data from PDF into dataframe and save it as csv or json 
Python :: Django Rest Retrieve API View with Slug 
Python :: how to create one list from 2d list python 
Python :: for loop to select rows in pandas 
Python :: sklearn grid search cross validation show progress 
Python :: matplotlib remove white lines between contour 
Python :: python wrapper function 
Python :: print type on each cell in column pandas 
Python :: django add to cart 
Python :: STATPC 
Python :: import open3d Illegal instruction (core dumped) 
Python :: element not interactable headless chrome 
Python :: colorbar with hist2d 
Python :: difference between local and global variable in python 
Python :: plotly ylog 
Python :: entry tkinter 
Python :: pytorch tensor argmax 
Python :: how to capitalize words in python 
Python :: plotly dash datatable column width 
Python :: django error displaying images page not found 
Python :: python boucle for 
Python :: confusion matrix code 
Python :: git clone in python to tmp directory 
Python :: Python Deleting a Tuple 
Python :: keras functional api embedding layer 
Python :: search whole drive for a file in python 
Python :: how to use with statement in python 2.5 and earlier 
Python :: python "urllib3" download and save pdf 
Python :: searching for best k values in knn 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =