Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #-*- coding: utf-8 -*-
- import re
- clear_lines = []
- with open("Dylan.Moran.Monster.srt", 'r') as file: # загружаем файл
- lines = file.readlines() # Читаем все строки в список
- for sub in lines:
- if not re.match("(^\\d+\\n)", sub):
- if not "-->" in sub:
- if not re.match("(^\\n)", sub):
- clear_lines.append(sub)
- print(clear_lines)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement