Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. s = {
  2. "-HVC1": [
  3. (0,8),
  4. (12,18)
  5. ],
  6. "-HVC2": [(9, 17)]
  7. }
  8.  
  9. seq = []
  10. with open("my_huge_file.txt") as file:
  11. for line in file:
  12. if line.startswith("-"):
  13. tx = line.split("tank", 1)[0].strip()
  14. else:
  15. for start, end in s[tx]:
  16. seq.append(line[start:end])
  17.  
  18. print(seq)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement