Created
May 5, 2017 22:25
-
-
Save vladimirmyshkovski/9ae8ca69f8d71b27aa15f32ad7630db3 to your computer and use it in GitHub Desktop.
Python. Find files in directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
...: filelist=os.listdir('static/css/') | |
...: for fichier in filelist[:]: # filelist[:] makes a copy of filelist. | |
...: if not(fichier.endswith(".css")): | |
...: filelist.remove(fichier) | |
...: print(filelist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment