I have a program that places the PDFs of each mxd in the same folder. This is fine. I just need the mxds to be deleted (after the creation of the PDF) or I need the PDFs put into a seperate folder away from the mxds. Code is below :
import arcpy, os
folderPath = r"C:\2 - GEO-DATA PROCESSING SUPPORT\Permanent Site Maps\2_District MXDs"
for filename in os.listdir(folderPath):
fullpath = os.path.join(folderPath, filename)
if os.path.isfile(fullpath):
basename, extension = os.path.splitext(fullpath)
if extension.lower() == ".mxd":
mxd = arcpy.mapping.MapDocument(fullpath)
arcpy.mapping.ExportToPDF(mxd, basename + '.pdf')
os.remove(path)
import arcpy, os
folderPath = r"C:\2 - GEO-DATA PROCESSING SUPPORT\Permanent Site Maps\2_District MXDs"
for filename in os.listdir(folderPath):
fullpath = os.path.join(folderPath, filename)
if os.path.isfile(fullpath):
basename, extension = os.path.splitext(fullpath)
if extension.lower() == ".mxd":
mxd = arcpy.mapping.MapDocument(fullpath)
arcpy.mapping.ExportToPDF(mxd, basename + '.pdf')
os.remove(path)