Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. fulldata={}
  2.  
  3. line = "February 29, 2029 at 07:31AM You entered the office"
  4. matched = re.search('(^\w.*\d) at (\d.*\w) You (\w.*\w) the office', line)
  5. if matched:
  6.     date = matched.group(1)
  7.     time = matched.group(2)
  8.     action = matched.group(3)
  9.     print("Date#",date,"#")
  10.     fulldata[date][action] =time
  11. else:
  12.     print ("ERROR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement