title: How to extract all strings from re.findall() list to be converted into integers?
body: <p>I'm parsing some text and trying to retrieve all the numbers from the text and then gather their sum. I used a regex <code>re.findall([0-9]+)</code> and have retrieved the numbers successfully, but am having trouble converting ALL OF the retrieved numbers into integers. The below code returns an incorrect sum because it will only add the first number that appears in each line of the text. Below is the full code.</p>
  
  <pre><code>import re
  fname=raw_input('Whats up?')
  fh=open(fname, 'r')
  y=list()
  count=0
  
      for line in fh:
          y=re.findall('[0-9]+', line)
          inp=list(y)
          if y == []:
              continue
          count=count+int(y[0])
  print count
  </code></pre>