Last active
          July 6, 2016 21:34 
        
      - 
      
- 
        Save dougluce/5ed9d4a497302eda9c51abf31900105b to your computer and use it in GitHub Desktop. 
    Python Got Too Big
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from email.header import decode_header | |
| import sys,re | |
| for line in sys.stdin: | |
| if re.match('(From|Subject|To): ', line): | |
| dh = decode_header(line) | |
| print ' '.join([unicode(t[0], t[1] or 'ASCII') for t in dh]) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from email.header import decode_header | |
| import sys,re | |
| x = 0 | |
| for line in sys.stdin: | |
| if re.match('(From|Subject|To): ', line): | |
| dh = decode_header(line) | |
| print ' '.join([unicode(t[0], t[1] or 'ASCII') for t in dh]) | |
| x += 1 | |
| if x == 3: | |
| sys.exit() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment