title: How to call multiple functions using a file in python
body: <p>I have multiple functions that I have to run. Both functions that I have run individually just fine, however when I try to run them simultaneously, only the first function runs correctly. </p>
  
  <pre><code>#Read file Emma.txt
  fin = open('Emma.txt', 'r')
  
  
  '''
  Write a function wordNumbers which takes the file name and return
  number of words in the file
  '''
  
  def wordNumbers(fin):
  
      #count the number of words.
      num_words = 0  #staring point for line
      for line in fin:
              words = line.split() #create a list of line
              num_words += len(words) #add each line legnth together
      print num_words #print total number of words
  
  def lineNumbers(fin):
  
      #count the number of lines with a counter and while loop
      cnt = 0
      for line in fin:
              if cnt &lt; line:
                      cnt += 1
      print cnt
  
  wordNumbers(fin)
  
  lineNumbers(fin)
  </code></pre>