title: Python - ValueError: invalid literal for int() with base 10: ''
body: <p>Help, I keep getting ValueError: invalid literal for int() with base 10: '' when I try to extract an integer from a string!</p>
  
  <pre><code>from string import capwords
  import sys,os
  import re
  
  def parseint(List):
      newlist = [i for i in List if isinstance(i, int)]
      return newlist
  def getint(string):
      number = [int(x) for x in string.split("-")]
      return number
  
  file=open('./Class 1/usr_score.data','r')
  text=file.read()
  
  def get_num(x):
      return int(''.join(ele for ele in x if ele.isdigit()))
  
  split = text.split(",")
  
  split.sort(key = lambda k : k.lower())
  for i in split:
      print(i)
  
  print ('---------------------------------------')
  list1=[]
  for i in split:
      list1.append(str(i))
  
  num_list1=[]
  
  for i in list1:
      ints = re.findall(r'\b\d+\b', i)
  
      #ints = getint(i)[0]
      for i in ints:
          int1=i
      num_list1.append(i)
  
      #num_list1 = parseint(list1)
  
  num_list=num_list1
  
  
  for i in num_list:
      print(i)
  </code></pre>
  
  <p>The file usr_score.data contains:</p>
  
  <pre><code>user-1,aaa-1,usr-3,aaa-4,
  </code></pre>
  
  <p>What my code is is that it contains scores for a game and I want my program to sort them into alphabetical order. Can someone please fix my problem?</p>
  
  <p>Note: Some of the code in the program has not been used.</p>