Created
May 1, 2018 19:47
-
-
Save Luxato/7930658795b6dbf8be0db600cafbadb1 to your computer and use it in GitHub Desktop.
Read files in directory with python
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 xml.etree.ElementTree as ET | |
import pickle | |
import os | |
from os import listdir, getcwd | |
from os.path import join | |
directory = os.fsencode(dir_in_string) | |
for file in os.listdir(directory): | |
filename = os.fsdecode(file) | |
if filename[-3:] == "xml": |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment