Skip to main content
added 140 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Your mapDoc variable has no backslash between your workspace and MXD names. One way to address that is by using Python string formatting.

I would replace this:

mapDoc = arcpy.mapping.MapDocument(wrkspc + 'NoMap.mxd')

with this:

mapDoc = arcpy.mapping.MapDocument(r'{0}\{1}'.format(wrkspc,'NoMap.mxd'))

I would replace this:

mapDoc = arcpy.mapping.MapDocument(wrkspc + 'NoMap.mxd')

with this:

mapDoc = arcpy.mapping.MapDocument(r'{0}\{1}'.format(wrkspc,'NoMap.mxd'))

Your mapDoc variable has no backslash between your workspace and MXD names. One way to address that is by using Python string formatting.

I would replace this:

mapDoc = arcpy.mapping.MapDocument(wrkspc + 'NoMap.mxd')

with this:

mapDoc = arcpy.mapping.MapDocument(r'{0}\{1}'.format(wrkspc,'NoMap.mxd'))
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

I would replace this:

mapDoc = arcpy.mapping.MapDocument(wrkspc + 'NoMap.mxd')

with this:

mapDoc = arcpy.mapping.MapDocument(r'{0}\{1}'.format(wrkspc,'NoMap.mxd'))