title: Python code readability assistance
body: <p>I would like to improve my code's readability and formatting. I have this code, that works, but I feel like it could be tighter than this, I just can't seem to get it to work any other way.  The idea is to read a .txt file find incoming e-mail strings and organize the data by frequency of hour sent.</p>
  
  <p>Here is an example line that I'm looking for in the text:</p>
  
  <blockquote>
    <p>From email@emailaddress.com Sat Jan  5 09:14:16 2008</p>
  </blockquote>
  
  <p>Here is my code as it is today.</p>
  
  <pre><code>fname = input("Enter file:")
  if len(fname) &lt;1 : fname = "mbox-short.txt"
  fh = open(fname)
  time = list()
  hours = list()
  hr = dict()
  
  for line in fh:
          if not line.startswith("From "): continue
          words = line.split()
          time.append(words[5])
  
  for i in time:
          i.split(":")
          hours.append(i[:2])
  
  for h in hours:
          hr[h]=hr.get(h, 0)+1
  
  l = list()
  for k,v in hr.items():
          l.append((k,v))
  l.sort()
  for k, v in l:
          print (k,v)
  </code></pre>