<?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: Passing a path to a variable in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303713#M23620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;speachless!!&amp;nbsp; &lt;A href="https://www.youtube.com/watch?v=QzqHUzww-sk" title="https://www.youtube.com/watch?v=QzqHUzww-sk"&gt;Jermaine Gordon You Are God (Official Music Video) Lord I Surrender Album - YouTube&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2015 14:31:59 GMT</pubDate>
    <dc:creator>KONPETROV</dc:creator>
    <dc:date>2015-12-17T14:31:59Z</dc:date>
    <item>
      <title>Passing a path to a variable</title>
      <link>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303711#M23618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have the following code that I am trying to make it work as a tool. If I pass the paths to variables it works perfectly but when I pass them as Tool Parameters when I don't have any result. I don't know what to correct, but there must be some problem with the combination of tool parameter name + "the file a create". I tried also to import it to variable outside tool and then import the variable for use in the tool but nothing changed. This is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
from arcpy import env
from arcpy.sa import *


workspace = arcpy.GetParameterAsText(0)
values = arcpy.GetParameterAsText(1)
num_pnts = int(values)
demodel = arcpy.GetParameterAsText(2)
outReclass = Reclassify(demodel, "Value", RemapRange([[100,300,1],[301,500,0]]), "NODATA")
outReclass.save(workspace + "rcls")
n = 0
for i in range(num_pnts):
&amp;nbsp;&amp;nbsp;&amp;nbsp; n += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Spatially Balanced Points
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateSpatiallyBalancedPoints_ga(workspace + "rcls", 1, workspace + "point" + str(n))
&amp;nbsp;&amp;nbsp;&amp;nbsp; inRaster = workspace + "rcls"
&amp;nbsp;&amp;nbsp;&amp;nbsp; inObserverFeatures = "point" + str(n) + ".shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; outViewshed = Viewshed(inRaster, inObserverFeatures)
&amp;nbsp;&amp;nbsp;&amp;nbsp; outViewshed.save(workspace + "view" + str(n))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:33:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303711#M23618</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2021-12-11T14:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a path to a variable</title>
      <link>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303712#M23619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Try using os.path.join to put together your file paths outViewshed.save(os.path.join(workspace, &lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;"view"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt; + str(n)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 13:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303712#M23619</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-12-17T13:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a path to a variable</title>
      <link>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303713#M23620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;speachless!!&amp;nbsp; &lt;A href="https://www.youtube.com/watch?v=QzqHUzww-sk" title="https://www.youtube.com/watch?v=QzqHUzww-sk"&gt;Jermaine Gordon You Are God (Official Music Video) Lord I Surrender Album - YouTube&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 14:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/passing-a-path-to-a-variable/m-p/303713#M23620</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-12-17T14:31:59Z</dc:date>
    </item>
  </channel>
</rss>

