title: efficiently read major version number from a file
body: <p>I am writing a script that will check the major version  by reading the file</p>
  
  <p>that at any line stores the version number Major.Minor.Fix</p>
  
  <p>like this:</p>
  
  <pre><code>VERSION = 23.5.1
  </code></pre>
  
  <p>so to read this number 23 I am doing this </p>
  
  <pre><code>filePath = os.path.join(os.getcwd(), 'Makefile')
  with open(filePath, 'r') as mkfh:
      for line in mkfh:
          if line.startswith('VERSION'):
              print line.replace(' ','').split('=')[-1].split('.')[0]
              break
  </code></pre>
  
  <p>is their more efficient way of getting the major version then using replace and split twice ?</p>