<?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: handling spaces in variables in Python in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698513#M23145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It wasn't the raw strings that was causing the problem.... embarrassingly...it was me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was using a filepath that didn't exist...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 04:57:25 GMT</pubDate>
    <dc:creator>DustinEdge</dc:creator>
    <dc:date>2010-11-17T04:57:25Z</dc:date>
    <item>
      <title>handling spaces in variables in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698511#M23143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings All&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to write a script that takes a dataset from the drop-down option in a tool, extracts the filename and folder path from it, determine whether the folder is a normal folder or a gdb, queries the type of dataset it is (point, line, polygon, raster) and write it all to a text file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the way our file system is setup is causing me pain. Here's a typical filepath:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;J:\MMPL\60153995\4. Tech Work Area\4.7 GIS\Mike11_data.gdb\DHI_CrossSections&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;* Note the spaces in the path&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is that when trying to run the script in PythonWin I have to insert the whole path in "" "" to get Python to see it as one variable. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I don't, it thinks that only &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;J:\MMPL\60153995\4.&lt;/SPAN&gt;&lt;SPAN&gt; is the variable's contents&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But that works as I can use &lt;/SPAN&gt;&lt;STRONG&gt;os.path.dirname&lt;/STRONG&gt;&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;&lt;STRONG&gt;os.path.basename&lt;/STRONG&gt;&lt;SPAN&gt; to extract the filename &amp;amp; folderpath. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;BUT....I can't use the variable in a Describe on that variable. It returns a 999999 RunTimeError.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The goal is to have a script that I can use to populate a data register of sorts. I wasn't expecting to get bogged down on this simple first bit...argh.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 05:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698511#M23143</guid>
      <dc:creator>DustinEdge</dc:creator>
      <dc:date>2010-11-16T05:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: handling spaces in variables in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698512#M23144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try raw strings. You use an r flag at the begining of the string. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;r'string'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 11:53:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698512#M23144</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-11-16T11:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: handling spaces in variables in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698513#M23145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It wasn't the raw strings that was causing the problem.... embarrassingly...it was me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was using a filepath that didn't exist...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 04:57:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698513#M23145</guid>
      <dc:creator>DustinEdge</dc:creator>
      <dc:date>2010-11-17T04:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: handling spaces in variables in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698514#M23146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ha! If I had a dollar for every typo and wrong path Ive had I could hire a programmer to do this stuff for me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 11:39:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698514#M23146</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-11-18T11:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: handling spaces in variables in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698515#M23147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ha! If I had a dollar for every typo and wrong path Ive had I could hire a programmer to do this stuff for me. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I'd be retired, living in luxury in some tropical isle, drinking Pina Coloda's a boring everyone with how the Intersect tool works...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 20:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/handling-spaces-in-variables-in-python/m-p/698515#M23147</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2010-11-19T20:54:09Z</dc:date>
    </item>
  </channel>
</rss>

