<?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: Run Model Builder models thru Python. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87349#M6837</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the script that i used in case any others run into this. this works!!! and it generates a log for you. &lt;/P&gt;&lt;P&gt;import arcpy, time, os, sys&lt;/P&gt;&lt;P&gt;from subprocess import *&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = False&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy, time, os, sys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date = time.strftime("%m-%d-%Y", time.localtime())&lt;/P&gt;&lt;P&gt;Time = time.strftime ("%I:%M:%S :p",time.localtime())&lt;/P&gt;&lt;P&gt;LogFile = file(r"C:\UGM_Projected\Scripts\TEST_1_" + Date + ".txt", 'w')&lt;/P&gt;&lt;P&gt;Generate = open(r"C:\UGM_Projected\Scripts\TEST_1_" + Date + ".txt", 'w')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Script Started At: " + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#run child script 1&lt;/P&gt;&lt;P&gt;p = Popen([r"C:\UGM_Projected\Scripts\UDF_FeatureclasstoSHP.py", "ArcEditor"], shell=True, stdin=PIPE, stdout=PIPE)&lt;/P&gt;&lt;P&gt;output = p.communicate()&lt;/P&gt;&lt;P&gt;print output[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Success!! UDF_FeatureclasstoSHP.py" + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#run child script 2&lt;/P&gt;&lt;P&gt;p = Popen([r"C:\UGM_Projected\Scripts\SHP_FeatureClass.py", "ArcEditor"], shell=True, stdin=PIPE, stdout=PIPE)&lt;/P&gt;&lt;P&gt;output = p.communicate()&lt;/P&gt;&lt;P&gt;print output[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Success!! SHP_FeatureClass.py" + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#run child script 3&lt;/P&gt;&lt;P&gt;p = Popen([r"C:\UGM_Projected\Scripts\Delete_SHP.py", "ArcEditor"], shell=True, stdin=PIPE, stdout=PIPE)&lt;/P&gt;&lt;P&gt;output = p.communicate()&lt;/P&gt;&lt;P&gt;print output[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Success!!&amp;nbsp; Delete_SHP.py " + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# reset date and time from when&amp;nbsp; started&lt;/P&gt;&lt;P&gt;lDate = time.strftime("%m-%d-%Y", time.localtime())&lt;/P&gt;&lt;P&gt;lTime = time.strftime("%I:%M:%S %p",time.localtime())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write(str("Script Ended at&amp;nbsp; " + str(lDate) + " " + str(lTime) + "." ))&lt;/P&gt;&lt;P&gt;Generate.close()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now = time.time()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print "Script Complete"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Aug 2015 15:02:15 GMT</pubDate>
    <dc:creator>lelaharrington</dc:creator>
    <dc:date>2015-08-18T15:02:15Z</dc:date>
    <item>
      <title>Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87338#M6826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have 4 models that i created i am trying to run them thru python to get them to execute one at a time. i have two ways i want to try to do this. a. have python run the models ( to no success as of yet) &lt;/P&gt;&lt;P&gt;b. export each model out as a script and have a master script that calls on 4 scripts to run one after the other until all 4 have ran in sequence. &lt;/P&gt;&lt;P&gt;i am very new to this and would love any help. &lt;/P&gt;&lt;P&gt;here is what i have so far. and here are my errors &lt;/P&gt;&lt;P&gt;ERROR&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "F:\GIS\Python_Scripts\GLE_BIS_Silverlight_Overwrite\Archive\Delete_Temp_Holding.py", line 16, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportToolbox("F:/GIS/Python_Scripts/GLE_BIS_Silverlight_Overwrite/GLE_BIS.tbx")&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\__init__.py", line 90, in ImportToolbox&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return import_toolbox(input_file, module_name)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\toolbox_code.py", line 441, in import_toolbox&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mymodule = generate_toolbox_module(toolbox, None, False, False, False, module_name, use_alt_alias)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\toolbox_code.py", line 416, in generate_toolbox_module&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exec')&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "F:\GIS\Python_Scripts\GLE_BIS_Silverlight_Overwrite\GLE_BIS.tbx", line 63&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def SHP-BIS():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/P&gt;&lt;P&gt;SyntaxError: invalid syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script&lt;/P&gt;&lt;P&gt;import arcpy, time, os, sys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date = time.strftime("%m-%d-%Y", time.localtime())&lt;/P&gt;&lt;P&gt;Time = time.strftime ("%I:%M:%S :p",time.localtime())&lt;/P&gt;&lt;P&gt;LogFile = file(r"F:\GIS\Python_Scripts\Logs\GLE to BIS PROJECTION AND TRANSFER_" + Date + ".txt", 'w')&lt;/P&gt;&lt;P&gt;output = open(r"F:\GIS\Python_Scripts\Logs\GLE to BIS PROJECTION AND TRANSFER_" + Date + ".txt", 'w')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.ImportToolbox("F:/GIS/Python_Scripts/GLE_BIS_Silverlight_Overwrite/GLE_BIS.tbx")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Local variables:&lt;/P&gt;&lt;P&gt;output.write("Script Started At: " + str(Date) + " " + str(Time) + "." + "\n" + "Start Delete Process" +"\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Delete Temp Holding Shapefiles&lt;/P&gt;&lt;P&gt;arcpy.DeleteTempHolding_GLE_BIS()&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Delete Temp Holding Shapefiles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.DeleteTempHolding_GLE_BIS():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output.write("Delete of Temporary files SUCCESS","\n")&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output.write("Delete of Temporary files FAIL","\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output.write("END OF SCRIPT","\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# reset date and time from when&amp;nbsp; started&lt;/P&gt;&lt;P&gt;lDate = time.strftime("%m-%d-%Y", time.localtime())&lt;/P&gt;&lt;P&gt;lTime = time.strftime("%I:%M:%S %p",time.localtime())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# write to log and close&lt;/P&gt;&lt;P&gt;output.write(str("GLE to BIS Script Ended at&amp;nbsp; " + str(lDate) + " " + str(lTime) + "." + "\n"))&lt;/P&gt;&lt;P&gt;output.close()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now = time.time()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print "Script Complete"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 15:35:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87338#M6826</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-06-25T15:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87339#M6827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to &lt;A href="http://resources.arcgis.com/en/help/main/10.1/018v/018v0000005z000000.htm"&gt;the documentation&lt;/A&gt;​ for &lt;SPAN style="font-family: 'courier new', courier;"&gt;ImportToolbox()&lt;/SPAN&gt;:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;If the toolbox does not have an alias, the &lt;SPAN style="font-family: 'courier new', courier;"&gt;module_name&lt;/SPAN&gt; is required.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Does your toolbox have an alias?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 17:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87339#M6827</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-06-25T17:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87340#M6828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Lela Harrington&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 17:58:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87340#M6828</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-06-25T17:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87341#M6829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;problem is not solved at all yet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Lela Harrington&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 18:21:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87341#M6829</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-06-25T18:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87342#M6830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I would wipe out the underscores from your model and then provide a second argument to your import toolbox statement and then use that when calling the tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;That is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Change &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;DeleteTempHolding_GLE_BIS to &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;DeleteTempHoldingGLEBIS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;arcpy.ImportToolbox("F:/GIS/Python_Scripts/GLE_BIS_Silverlight_Overwrite/GLE_BIS.tbx", "myTbx")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Then call your tool:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;arcpy.DeleteTempHoldingGLEBIS_myTbx()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 19:55:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87342#M6830</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2015-07-02T19:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87343#M6831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ill give it a try and let you know . thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Lela Harrington&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 20:01:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87343#M6831</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-07-02T20:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87344#M6832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lela,&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;deleted some bad information&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help others with viewing your code for debugging, check out &lt;A href="https://community.esri.com/migration-blogpost/1070"&gt;Posting Code blocks in the new GeoNet&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spacing is critical in Python code, and Geonet has a way of altering the spacing which makes it hard to debug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, I personally, I like your second approach (b.) to create separate scripts (instead of leaving them i model builder), but that is just because I feel you can have more control when scripting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; eliminated bad(thanks for catching that Dan)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2015 00:11:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87344#M6832</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-07-05T00:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87345#M6833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if i create the additional scripts instead of calling the model how can i call multi scripts into one script?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Lela Harrington&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 19:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87345#M6833</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-07-07T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87346#M6834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can export each model as a python script, then you can copy all four scripts into one .py file enclosed in function definitions, then run each function in turn at the bottom of that file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def func1():
&amp;nbsp; do stuff

def func2():
&amp;nbsp; do more stuff

def func3():
&amp;nbsp; and yet more

def func4():
&amp;nbsp; last stuff

func1()
func2()
func3()
func4()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:20:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87346#M6834</guid>
      <dc:creator>JeffWard</dc:creator>
      <dc:date>2021-12-10T23:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87347#M6835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lela, in my workflow I'm usually running one script (from either a custom Toolbox or a Python addin I created), because I typically want to look at the result before I run the next.&amp;nbsp; However, you can stack up scripts, models, tools, etc and the will process in order, however, if there is an error in the first, it may not stop the second from running..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there are many threads out there on the subject, and a quick search came up with &lt;A href="http://gis.stackexchange.com/questions/11339/arcpy-and-running-python-scripts-with-parameters-within-another-python-script" title="http://gis.stackexchange.com/questions/11339/arcpy-and-running-python-scripts-with-parameters-within-another-python-script"&gt;arcgis 10.0 - ArcPy and running Python scripts (with parameters) within another Python script - Geographic Information S…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It's 10.0, but I'm sure its about the same for any 10.0+.&amp;nbsp; When looking at some of the comments on that page, it referenced a broken link to a blog from &lt;A href="https://community.esri.com/migrated-users/9283"&gt;Jason Pardy&lt;/A&gt;​ which lead me to search the blog, and although I didn't find the one references, I did find another &lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/24/exportmodeltopy/" title="http://blogs.esri.com/esri/arcgis/2011/06/24/exportmodeltopy/"&gt;Considerations when exporting a model to a Python script | ArcGIS Blog&lt;/A&gt; which looks like something you should look at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm also interested in finding an answer to your question....not that I need it right now, but always good to know.&amp;nbsp; I use Geonet to research many of my questions....but doing a straight browser search can give you many leads too.&amp;nbsp; But there may be others here that have better ways.&amp;nbsp; Many tools in the toolbox! (thankfully!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDTI: looks like Jeff already provided an answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 20:39:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87347#M6835</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-07-07T20:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87348#M6836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your information on this. &lt;/P&gt;&lt;P&gt;here is what i finally went with. &lt;/P&gt;&lt;P&gt;imported arcpy,os &lt;/P&gt;&lt;P&gt;from subprocess import * &lt;/P&gt;&lt;P&gt;then i ran 4 child scripts after i converted each model to a script. i then called each script as a child script, had log findings embeded in the script to report back success&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 16:26:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87348#M6836</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-08-13T16:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87349#M6837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the script that i used in case any others run into this. this works!!! and it generates a log for you. &lt;/P&gt;&lt;P&gt;import arcpy, time, os, sys&lt;/P&gt;&lt;P&gt;from subprocess import *&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = False&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy, time, os, sys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date = time.strftime("%m-%d-%Y", time.localtime())&lt;/P&gt;&lt;P&gt;Time = time.strftime ("%I:%M:%S :p",time.localtime())&lt;/P&gt;&lt;P&gt;LogFile = file(r"C:\UGM_Projected\Scripts\TEST_1_" + Date + ".txt", 'w')&lt;/P&gt;&lt;P&gt;Generate = open(r"C:\UGM_Projected\Scripts\TEST_1_" + Date + ".txt", 'w')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Script Started At: " + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#run child script 1&lt;/P&gt;&lt;P&gt;p = Popen([r"C:\UGM_Projected\Scripts\UDF_FeatureclasstoSHP.py", "ArcEditor"], shell=True, stdin=PIPE, stdout=PIPE)&lt;/P&gt;&lt;P&gt;output = p.communicate()&lt;/P&gt;&lt;P&gt;print output[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Success!! UDF_FeatureclasstoSHP.py" + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#run child script 2&lt;/P&gt;&lt;P&gt;p = Popen([r"C:\UGM_Projected\Scripts\SHP_FeatureClass.py", "ArcEditor"], shell=True, stdin=PIPE, stdout=PIPE)&lt;/P&gt;&lt;P&gt;output = p.communicate()&lt;/P&gt;&lt;P&gt;print output[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Success!! SHP_FeatureClass.py" + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#run child script 3&lt;/P&gt;&lt;P&gt;p = Popen([r"C:\UGM_Projected\Scripts\Delete_SHP.py", "ArcEditor"], shell=True, stdin=PIPE, stdout=PIPE)&lt;/P&gt;&lt;P&gt;output = p.communicate()&lt;/P&gt;&lt;P&gt;print output[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write("Success!!&amp;nbsp; Delete_SHP.py " + str(Date) + " " + str(Time) + "." + "\n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# reset date and time from when&amp;nbsp; started&lt;/P&gt;&lt;P&gt;lDate = time.strftime("%m-%d-%Y", time.localtime())&lt;/P&gt;&lt;P&gt;lTime = time.strftime("%I:%M:%S %p",time.localtime())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate.write(str("Script Ended at&amp;nbsp; " + str(lDate) + " " + str(lTime) + "." ))&lt;/P&gt;&lt;P&gt;Generate.close()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now = time.time()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print "Script Complete"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 15:02:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87349#M6837</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-08-18T15:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Run Model Builder models thru Python.</title>
      <link>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87350#M6838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1070"&gt;Posting Code blocks in the new GeoNet&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 22:11:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-model-builder-models-thru-python/m-p/87350#M6838</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-08-18T22:11:45Z</dc:date>
    </item>
  </channel>
</rss>

