Created
July 30, 2018 20:41
-
-
Save discarn8/8fd1bbbc0d1f3cfbc0465157c69bb7e2 to your computer and use it in GitHub Desktop.
Python_list_specific_filetypes_in_directory
This file contains hidden or 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 | |
| #Change csv to match the file extension you are searching for | |
| path = "C:/path/to/files/*.csv" | |
| for fname in glob.glob(path): | |
| temp1=os.path.basename(os.path.normpath(fname)) | |
| filename=temp1.split('.')[0] | |
| print(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment