<?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: Python script runs but doesn't change anything in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341124#M26746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't give an error because if you enter a function without the () Python will simply return the text representation of the object "arcpy.method".&amp;nbsp; (The method has been imported, so it exists, so no error.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Apr 2015 01:00:23 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2015-04-30T01:00:23Z</dc:date>
    <item>
      <title>Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341116#M26738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been doing some testing with models that I want to schedule and to start with I created a basic model that only creates a feature class within one of my file geodatabases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My toolbox name is: CDWGeocoding&lt;/P&gt;&lt;P&gt;The alias name is: CDWGeo&lt;/P&gt;&lt;P&gt;Model name: ImportTest&lt;/P&gt;&lt;P&gt;This model has no parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been running the following script (which completes just fine).&amp;nbsp; The problem is the feature class is not being created.&amp;nbsp; This runs fine with ArcGIS just not when running through a script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;import os&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;from datetime import datetime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;print("Starting toolbox import.....") &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;arcpy.ImportToolbox(r"C:\Users\JOEBOBSMITH\Documents\ArcGIS\CDWGeocoding.tbx")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;print("Import Complete")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;print("Model executing.....")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;try:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#CDWGeo is the toolbox alias&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportTest_CDWGeo&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Model complete.")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;except:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcy.GetMessages(2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been using this page as a reference:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/" title="http://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/"&gt;Scheduling a Python script or model to run at a prescribed time | ArcGIS Blog&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone see any problems with this script?&amp;nbsp; It seems pretty straight forward and simple.&amp;nbsp; I'm sure it's something simple that I am missing.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341116#M26738</guid>
      <dc:creator>Jim_Gay</dc:creator>
      <dc:date>2015-04-28T15:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341117#M26739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's hard to tell without seeing the model or the toolbox, but is it printing all the messages? What about the final GetMessage?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341117#M26739</guid>
      <dc:creator>SepheFox</dc:creator>
      <dc:date>2015-04-28T15:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341118#M26740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All messages are being printed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="python_ss.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/91163_python_ss.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can post an image of the model shortly.&amp;nbsp; It's just the one tool to create the feature class.&amp;nbsp; Very basic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:37:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341118#M26740</guid>
      <dc:creator>Jim_Gay</dc:creator>
      <dc:date>2015-04-28T15:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341119#M26741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the model in questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="python_model.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/91164_python_model.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Properties of create feature class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="python_props.jpg" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/91165_python_props.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:44:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341119#M26741</guid>
      <dc:creator>Jim_Gay</dc:creator>
      <dc:date>2015-04-28T15:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341120#M26742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm wondering if the feature class is being created, but not where you expect it to. I think you need to set the workspace in the python script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:48:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341120#M26742</guid>
      <dc:creator>SepheFox</dc:creator>
      <dc:date>2015-04-28T15:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341121#M26743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried adding this piece of code but the results are still the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Set workspace&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;uri = r"C:\Users\JOEBOBSMITH\Documents\ArcGIS\PDADEV.gdb" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;arcpy.env.workspace = uri &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:58:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341121#M26743</guid>
      <dc:creator>Jim_Gay</dc:creator>
      <dc:date>2015-04-28T15:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341122#M26744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;You are calling your function as a property of arcpy, not a function (not sure why it doesn't give an error, but it's not doing what you think it's doing). It should be:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14302369824293605 jive_text_macro" data-renderedposition="71_8_912_16" jivemacro_uid="_14302369824293605"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;arcpy.ImportTest_CDWGeo()&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 16:03:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341122#M26744</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-04-28T16:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341123#M26745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes it takes a village!&amp;nbsp; Thank you.&amp;nbsp; Working perfectly now.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 16:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341123#M26745</guid>
      <dc:creator>Jim_Gay</dc:creator>
      <dc:date>2015-04-28T16:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python script runs but doesn't change anything</title>
      <link>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341124#M26746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't give an error because if you enter a function without the () Python will simply return the text representation of the object "arcpy.method".&amp;nbsp; (The method has been imported, so it exists, so no error.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 01:00:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-runs-but-doesn-t-change-anything/m-p/341124#M26746</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-04-30T01:00:23Z</dc:date>
    </item>
  </channel>
</rss>

