Advertisement
DecebalICT

Display cleaned XChat logs

Aug 1st, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from __future__     import division, print_function
  2.  
  3.  
  4. from os.path        import expanduser
  5.  
  6.  
  7. real_file = expanduser('~/.xchat2/xchatlogs/FreeNode-##python-friendly.log')
  8. with open(real_file, 'r') as f:
  9.     for line in f:
  10.         if not ((line == '\n')           or \
  11.                 line.startswith('**** ') or \
  12.                 (line[15:18] == ' *\t')     \
  13.         ):
  14.             print(line, end = '')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement