1 # clear out old pdfs 2 print '\nDeleting old PDFs...' 3 oldPDFs = os.listdir(outputFolder) 4 for f in oldPDFs: 5 os.remove(outputFolder + '\\' + f) 6 7 # get list of all files in the folder 8 print '\nGetting list of mxds...' 9 allItems = os.listdir(baseFolder) 10 # filter out just .mxd's 11 mxdFileNames = [(x) for x in allItems if x.endswith('.mxd')] 12 mxdFileNames.sort()