I have a project where I have many MXDs in one folder, and would like to export each one to JPGs in another folder. I've been stumped with a particular error message I'm running in to:
Traceback (most recent call last):
File "string", line 5, in module
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'T:\Projects\t TIP\FY2018\New folder/.'
This is the code I'm using:
import arcpy, os inputPath = 'T:\Projects\411 TIP\FY2018\FY2018 TIP Database.gdb' outputPath = 'T:\Projects\411 TIP\TIP Database\Project_Maps\2019' #Loop through each MXD file for filename in os.listdir(inputPath): for filename in os.listdir(inputPath): fullpath = os.path.join(inputPath, filename) if os.path.isfile(fullpath): if filename.lower().endswith(".mxd"): #Reference MXD and export mxd = arcpy.mapping.MapDocument(fullpath) arcpy.mapping.ExportToJPEG(mxd, outputPath + "\\" + filename + ".jpg")
I apologize if this is a simple fix, I am new to using python.