<?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: new to python... in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/new-to-python/m-p/299609#M23186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris, I recommend this *free* online course to get you started right:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&amp;amp;courseid=2520 "&gt;&lt;BR /&gt;'&amp;gt;Python for Everyone Using ArcGIS 10.1&lt;BR /&gt;&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Mar 2013 22:29:25 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2013-03-24T22:29:25Z</dc:date>
    <item>
      <title>new to python...</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python/m-p/299606#M23183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;new to python AND new to arcgis 9.3, coming from mapbasic background.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm learning some python for scripting in 9.3, and come up with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# create the geoprocessor object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.workspace = "I:\PDtest"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# process&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.PointDistance_analysis("stores.shp", "competitors.shp", "output.dbf", "1000 meters")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...it runs fine, but, what if I wanted to have a user input the names etc into a text box before this continued?&amp;nbsp; like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;workspace_entry = raw_input('please enter path to workspace')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;layer1 = raw_input('please enter first layer')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;layer2 = raw_input('please enter second layer')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or something like that; it crashes when I try, but still very new to all of this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 16:43:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python/m-p/299606#M23183</guid>
      <dc:creator>ChrisJ</dc:creator>
      <dc:date>2013-03-22T16:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: new to python...</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python/m-p/299607#M23184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The answer depends on if you are running this script standalone, or as a tool from ArcMap. As a standalone, the raw_input should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting

# create the geoprocessor object
gp = arcgisscripting.create(9.3)

gp.workspace = raw_input('please enter path to workspace')

# process
layer1 = raw_input('please enter first layer')
layer2 = raw_input('please enter second layer')
gp.PointDistance_analysis(layer1, layer2, "output.dbf", "1000 meters")

etc.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this script is being run as a tool from ArcMap, you will need to set up tool parameters, then use the appropriate gp command to insert them into the script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting

# create the geoprocessor object
gp = arcgisscripting.create(9.3)

gp.workspace = gp.getparameterastext(0)

# process
layer1 = gp.getparameterastext(1)
layer2 = gp.getparameterastext(2)
gp.PointDistance_analysis(layer1, layer2, "output.dbf", "1000 meters")

etc.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI, if you're going to use backslashes in a hard-coded path name, either designate it as a raw string (r"I:\PDtest") or use a double backslash ("I:\\PDtest"). Using a forwardslash ("I:/PDtest") is acceptable as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python/m-p/299607#M23184</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2021-12-11T14:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: new to python...</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python/m-p/299608#M23185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bruce thanks very much for your dual explanation; I'll give this a try and see how it goes...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:20:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python/m-p/299608#M23185</guid>
      <dc:creator>ChrisJ</dc:creator>
      <dc:date>2013-03-22T17:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: new to python...</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python/m-p/299609#M23186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris, I recommend this *free* online course to get you started right:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&amp;amp;courseid=2520 "&gt;&lt;BR /&gt;'&amp;gt;Python for Everyone Using ArcGIS 10.1&lt;BR /&gt;&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Mar 2013 22:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python/m-p/299609#M23186</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-03-24T22:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: new to python...</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python/m-p/299610#M23187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks very much cvp, will check this out....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 11:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python/m-p/299610#M23187</guid>
      <dc:creator>ChrisJ</dc:creator>
      <dc:date>2013-03-25T11:52:28Z</dc:date>
    </item>
  </channel>
</rss>

