How to use a wildcard in python to check for any extension
<p>I am trying to check the input to see if it has any extension here is the code I used:</p>

<pre><code>filename=input()
if "." in filename:
    print ("There is")
</code></pre>

<p>However this will return "there is" even if the input is ends with just a full stop.<br>
  Is there any way to check if the input has any letters after the "."?
  I can't specify what the extension should be (as it is up to the user), just that there should be an extension. </p>

<p>I used the <code>find</code> function to locate the character <code>.</code> in <code>me</code>. If the character doesn't exist in <code>me</code>, the function returns <code>-1</code>. Then, with the index of the <code>.</code> character, I see if there are any characters after that index with <code>len(me[index + 1:])</code>. If the <code>len</code> function returns a positive number, then you know there are characters after the <code>.</code> character.</p>

<pre><code>me=input()
index = me.find(".")
if (index != -1 and len(me[index + 1:]) &gt; 0):
    print ("There is")
</code></pre>

<p>It might not be the most elegant way to solve this with Python, but it covers the basics of your problem without getting too fancy.</p>

python wildcard