I have a simple script that is doing some parsing of the mxd that I pass it. The script works just fine if I hard code the name of the mxd into the script, however I would like to pass the full path of the mxd to the script when I run it. This seems to be an issue since the examples I have seen all have the “r” in them prior to the path and mxd name. For example(this works by the way):
I’ve tried a number of things but haven’t figured out how to get around this simple problem. For Example:
Also tried:
Thanks for your help in advance!
Code:
mxd = arcpy.mapping.MapDocument(r"C:\Data\GISData\PythonCode\test.mxd")
I’ve tried a number of things but haven’t figured out how to get around this simple problem. For Example:
Code:
mxdIn = sys.argv[0]
mxd = arcpy.mapping.MapDocument(mxdIn)
Code:
mxdIn = sys.argv[0]
mxd = arcpy.mapping.MapDocument(r (mxdIn))
Thanks for your help in advance!