Run python code on a folder of XMLs
Question: I would like to be able to run the following code on a folder of XML files
rather than a single one. I also do no want to change the `xmlfile =
'test.xml'` line 100+ times for each file.

This is the example `elementTree` code that I found and am testing.

    
    
    from openpyxl import Workbook
    import xml.etree.ElementTree as ET
    
    xmlfile = 'test.xml'
    element_tree = ET.parse(xmlfile)
    root = element_tree.getroot()
    agreement = root.find(".//tag").text
    
    print (agreement)
    
    wb = Workbook()
    kevin = ["1", "2", "3"]
    
    # grab the active worksheet
    ws = wb.active
    
    # Data can be assigned directly to cells
    ws['A1'] = 42
    
    # Rows can also be appended
    ws.append[(agreement)]
    ws.append(kevin)
    
    # Save the file
    wb.save("sample.xlsx")
    


Answer: Better go with this.

    
    
    import os
    import fnmatch
    #os.getcwd() or a specific path of the need
    path = os.getcwd() + '/open'
    mee = [os.path.join(dirpath, f)
        for dirpath, dirnames, files in os.walk(path)
        for f in fnmatch.filter(files, '*.xml')]
    
    for ffile in mee:
        #do other stuff
    

