title: How do I find one number in a string in Python?
body: <p>I have a file called something like FILE-1.txt or FILE-340.txt. I want to be able to get the number from the file name. I've found that I can use</p>
  
  <pre><code>numbers = re.findall(r'\d+', '%s' %(filename))
  </code></pre>
  
  <p>to get a list containing the number, and use numbers[0] to get the number itself as a string... But if I know it is just one number, it seems roundabout and unnecessary making a list to get it. Is there another way to do this?</p>
  
  <hr>
  
  <p>Edit: Thanks! I guess now I have another question. Rather than getting a string, how do I get the integer?</p>