<?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: Using user input argument as a wildcard in ListFeatureClasses in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/1223750#M65899</link>
    <description>&lt;P&gt;Thank you!!! Could not figure out how to do this.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 11:59:08 GMT</pubDate>
    <dc:creator>MICHELLESTEPHENS</dc:creator>
    <dc:date>2022-10-20T11:59:08Z</dc:date>
    <item>
      <title>Using user input argument as a wildcard in ListFeatureClasses</title>
      <link>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/314633#M24456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a script that will allow the user to create a list of feature classes, in a directory, where the wildcard is set by a user input argument (sys.argv[2]).&amp;nbsp; But, I cannot figure out how to get the argument into the optional parameters (between the two asterisks).&amp;nbsp; Here is the code that I am working on:&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="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;argv&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;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;


sub &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;argv&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;

fileList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&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;/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;&lt;/P&gt;&lt;P&gt;Edited because I just figured out how to insert code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:59:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/314633#M24456</guid>
      <dc:creator>WilliamHerzig</dc:creator>
      <dc:date>2021-12-11T14:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using user input argument as a wildcard in ListFeatureClasses</title>
      <link>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/314634#M24457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming sub is a string already:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;fileList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&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; sub &lt;SPAN class="operator 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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;fileList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&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;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sub&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2020 15:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/314634#M24457</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-06-30T15:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using user input argument as a wildcard in ListFeatureClasses</title>
      <link>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/314635#M24458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much that worked perfectly, I had tried the format, but had it located incorrectly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was how I had tried it -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fileList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*{0}*'&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;sub&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:59:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/314635#M24458</guid>
      <dc:creator>WilliamHerzig</dc:creator>
      <dc:date>2021-12-11T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using user input argument as a wildcard in ListFeatureClasses</title>
      <link>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/1223750#M65899</link>
      <description>&lt;P&gt;Thank you!!! Could not figure out how to do this.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 11:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-user-input-argument-as-a-wildcard-in/m-p/1223750#M65899</guid>
      <dc:creator>MICHELLESTEPHENS</dc:creator>
      <dc:date>2022-10-20T11:59:08Z</dc:date>
    </item>
  </channel>
</rss>

