<?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: Removing .shp from user output/Changing Name in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569014#M44596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks once again Dan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That definitely clarifies it up for me! Ill check out the blog posts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Oct 2018 15:20:29 GMT</pubDate>
    <dc:creator>AdamThompson3</dc:creator>
    <dc:date>2018-10-11T15:20:29Z</dc:date>
    <item>
      <title>Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569003#M44585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I have created a tool that just mimics the Erase Tool but with a basic license, and the only problem I am running into is when the user selects the output as a shapefile, it messes with my file naming that I do with my processes such as intersect or union. The user is given 3 options to enter, inFc, EraseFc, and Outfc&lt;/P&gt;&lt;P&gt;For example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 000732: Selecting Features: Dataset D:\PythonDataTest\ERASE_TESTT.shp_Intersect does not exist or is not supported&lt;BR /&gt;Failed to execute (SelectLayerByLocation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/424038_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;As you can see it is trying to append the _Intersect behind the .shp of the output file name the user selected. And this of course wont work later on when my other processes try and find that shapefile.. SO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my question is how do I get the output name + the string im appending to it, to be before .shp and not after it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 22:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569003#M44585</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2018-10-09T22:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569004#M44586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make workspace parameter a folder, when gdb's are the workspace, it sort of does that.&amp;nbsp; When you specify a folder, it can't be a featureclass but a shapefile&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 22:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569004#M44586</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-09T22:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569005#M44587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan, Good Idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently what I am doing is making my workspace the same as the output feature class workspace such as this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WS = os.path.dirname(out_fc)&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = WS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My goal for this tool ideally would be for others to either input a feature class OR shapefile and have it run on either, trying not to limit the user to a specific workspace such as a folder if possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently it works fine when the user selects the output as a feature class, just looking to find a way to append that string to the name before the .shp so I&amp;nbsp; can call on that that XXX_XX_Intersect.shp later on in the script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569005#M44587</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2018-10-10T13:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569006#M44588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could simply try getting whatever name it gives you, then replace ".shp" with "" and reappend it to the final file, BUT that would require a folder as output.&lt;/P&gt;&lt;P&gt;If you separate the workspace from the output filename as I suggested, then you would have no issue.&amp;nbsp; If a gdb is selected as the workspace, then *.shp shouldn't be appended, but you could check and strip it in the code.&amp;nbsp; If a folder is the destination, then it should have a *.shp on the end, but if it doesn't you could append it in the final code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569006#M44588</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-10T14:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569007#M44589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just wanted to thank you again for the help! I found a&amp;nbsp; bit of a work around to it that works now, it is a bit long and tideous but I got it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically what I have done is Performed my Intersect operation at the very beginning with the user inputted&amp;nbsp;features&lt;/P&gt;&lt;P&gt;and then after that I created an IF statement saying if that output file is a shapefile perform this operation;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/424118_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;and then...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/424083_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;I used the function of [-4] +__NAME in order to get around my .shp naming problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the output of that first Operation was a feature class then perform the same operations without the [-4] on any of the names and all seems to be good now!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 22:26:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569007#M44589</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2018-10-10T22:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569008#M44590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it worked out Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 22:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569008#M44590</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-10T22:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569009#M44591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see you've got a working solution, which is great. I'll just point out the method "os.path.splitext()", which splits out the extension, regardless how long it is. This is handy when you don't exactly know the length of the extension (e.g. dealing with both .jpg and .jpeg):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; mypath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'path/to/some/shapefile.shp'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;splitext&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mypath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'path/to/some/shapefile'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; mypath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'path/to/some/geodatabase.gdb/featureclass'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;splitext&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mypath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'path/to/some/geodatabase.gdb/featureclass'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569009#M44591</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T00:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569010#M44592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was actually working with that exact function earlier but if the user output was a .shp and I split the text it would remove the .shp and not actually create the shapefile and I couldn't call on it later in the script. Do you know of a way to split the name of a shapefile like you have done above but add string before the .shp? For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test.shp --&amp;gt; Test_Intersect.shp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 13:55:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569010#M44592</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2018-10-11T13:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569011#M44593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cumbersome, but the key is the split, then the * in the format string.&amp;nbsp; You could make _intersect a variable if you wanted to&lt;/P&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;splitext&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mypath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{}_intersect{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;path&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;to&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;some&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;shapefile_intersect&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shp&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569011#M44593</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569012#M44594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is exactly what I needed to cut my script down in half from what I did earlier for the fix, It is now working for both .shp output and feature class output! Once again really appreciate the help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mind explaining to me what that result part does? For example what do the {} mean and I am assuming the *x is format everything in front of the last split part of the .shp? Just wanting to get a better understanding on it.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 14:44:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569012#M44594</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2018-10-11T14:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569013#M44595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;prepare for python 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{}_intersect{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"{0} whatever {1}"&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; means I can pass 2 things into this and it will convert those objects, of any kind, into strings.&amp;nbsp; with 'whatever' inbetween&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example I knew that there were only going to be two objects, the left and right parts of splitting the file path, so the '0' and '1' can be omitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*x&lt;/STRONG&gt; &amp;nbsp; means basically, unfold/unroll the pieces from 'x'&amp;nbsp; so you don't have to do explicit 'slicing' like&lt;STRONG&gt; x[0]&lt;/STRONG&gt; and &lt;STRONG&gt;x[1] &amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I could have written 'result' as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{}_intersect{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The nice thing about starred expressions and formatters is that you don't need to know how may things are in a thing... you just do it.&amp;nbsp; For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{} "&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;'1 2 3 4 5 '&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some blog posts on formatting in python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:30:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569013#M44595</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569014#M44596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks once again Dan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That definitely clarifies it up for me! Ill check out the blog posts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 15:20:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569014#M44596</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2018-10-11T15:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569015#M44597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If working in Python 3.4+, you can also use &lt;A class="link-titled" href="https://docs.python.org/3.4/library/pathlib.html" title="https://docs.python.org/3.4/library/pathlib.html" rel="nofollow noopener noreferrer" target="_blank"&gt;11.1. pathlib — Object-oriented filesystem paths — Python 3.4.9 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pathlib
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pathlib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Path&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\tmp\folder\test.shp"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;with_suffix&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\tmp\folder\test
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pathlib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Path&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\tmp\fgdb.gdb\test"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;with_suffix&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\tmp\fgdb&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gdb\test
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569015#M44597</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T00:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Removing .shp from user output/Changing Name</title>
      <link>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569016#M44598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There have been changes to os as well, which are now supported in pathlib&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/3.7/library/os.html#os.PathLike" title="https://docs.python.org/3.7/library/os.html#os.PathLike"&gt;os — Miscellaneous operating system interfaces — Python 3.7.1rc1 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and additions to and modifications of pathlib occurred in 3.5, and 3.6&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/3.7/library/pathlib.html" title="https://docs.python.org/3.7/library/pathlib.html"&gt;pathlib — Object-oriented filesystem paths — Python 3.7.1rc1 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2018 17:24:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/removing-shp-from-user-output-changing-name/m-p/569016#M44598</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-11T17:24:23Z</dc:date>
    </item>
  </channel>
</rss>

