Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. import re
  2.  
  3. line_pat = re.compile('field1=(d+); field2=(d+); field3=(d+);')
  4. with open(filepath, 'r') as f:
  5. array = [[int(n) for n in line_pat.match(line).groups()] for line in f]
Add Comment
Please, Sign In to add comment