<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Arcpy command to start MXD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486316#M37952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good question. Are you typing in the full path or giving it a variable with the path stored in it? &lt;/P&gt;&lt;P&gt;when I googled your error message I came across a similar stack exchange question &lt;A href="http://stackoverflow.com/questions/17318765/csv-mapping-coercing-to-unicode-need-string-or-buffer-list-found"&gt;here&lt;/A&gt;. I am by no means an expert with python but it looks like it might be expecting a string and instead getting a list or something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Apr 2015 13:35:15 GMT</pubDate>
    <dc:creator>NathanialStory1</dc:creator>
    <dc:date>2015-04-02T13:35:15Z</dc:date>
    <item>
      <title>Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486313#M37949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script that creates a series of maps via a python script. After the script runs the automation (via a batch file), i want to put in a command to actually launch/open the MXD files. I know I have used this syntax in the past, but I can't seem to locate it. Does anyone know what command to use for open an mxd? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 12:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486313#M37949</guid>
      <dc:creator>AndrewTuleya2</dc:creator>
      <dc:date>2015-04-02T12:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486314#M37950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;As far as an arcpy option, I am not sure. But I just tried this script and it worked for me within the python window in arcmap. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;os.startfile("Path to your mxd")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it emulates a double click event and opens pretty much any file you give it as far as I have seen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 13:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486314#M37950</guid>
      <dc:creator>NathanialStory1</dc:creator>
      <dc:date>2015-04-02T13:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486315#M37951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks this is what I was looking for! However, now i am getting an error message saying "Coercing to Unicode: need string or buffer, Map document found." Any idea what this means?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 13:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486315#M37951</guid>
      <dc:creator>AndrewTuleya2</dc:creator>
      <dc:date>2015-04-02T13:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486316#M37952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good question. Are you typing in the full path or giving it a variable with the path stored in it? &lt;/P&gt;&lt;P&gt;when I googled your error message I came across a similar stack exchange question &lt;A href="http://stackoverflow.com/questions/17318765/csv-mapping-coercing-to-unicode-need-string-or-buffer-list-found"&gt;here&lt;/A&gt;. I am by no means an expert with python but it looks like it might be expecting a string and instead getting a list or something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 13:35:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486316#M37952</guid>
      <dc:creator>NathanialStory1</dc:creator>
      <dc:date>2015-04-02T13:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486317#M37953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AH! I just tried &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;os.startfile() but replaced the variable in () with a hardcoded full path to another MXD and it worked fine! I might have to do some switching and play with the concatenation of a new variable due to the fact that my script automatically creates project folders and geodatabases unique to a project ID #. But this is a great start, thanks. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 13:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486317#M37953</guid>
      <dc:creator>AndrewTuleya2</dc:creator>
      <dc:date>2015-04-02T13:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486318#M37954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to use the &lt;SPAN style="font-family: 'courier new', courier;"&gt;r&lt;/SPAN&gt; &lt;A href="https://docs.python.org/2/reference/lexical_analysis.html#grammar-token-stringprefix" rel="nofollow noopener noreferrer" target="_blank"&gt;string prefix&lt;/A&gt; with path names so it escapes the backslashes.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mypath = r"C:\temp\myfile.mxd"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can construct file paths with &lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;A href="http://pymotw.com/2/ospath/" rel="nofollow noopener noreferrer" target="_blank"&gt;os.path&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-size: 12px; font-family: 'courier new', courier;"&gt;mydrive = "c:"&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier;"&gt;myfolder = "temp"&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier;"&gt;myfile = "mapdoc.mxd"&lt;/SPAN&gt;
&lt;SPAN style="font-family: 'courier new', courier;"&gt;mypath = os.path.join(mydrive, &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: 'courier new', courier; font-size: 12px;"&gt;myfolder&lt;/SPAN&gt;, myfile)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486318#M37954</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-11T21:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy command to start MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486319#M37955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, os.path.join is great, and here's just one more option:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;mypath = r"C:\{0}\{1}.mxd".format(myfolder, myfilename)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 22:42:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-command-to-start-mxd/m-p/486319#M37955</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2015-04-02T22:42:27Z</dc:date>
    </item>
  </channel>
</rss>

