Skip to content

Instantly share code, notes, and snippets.

@piyush0101
Created October 16, 2014 14:57
Show Gist options
  • Save piyush0101/d5df097e9ccfe6785d69 to your computer and use it in GitHub Desktop.
Save piyush0101/d5df097e9ccfe6785d69 to your computer and use it in GitHub Desktop.
import os
import re
with open('sept record.csv', 'r') as records:
minutes = 0.0
for line in records:
match = re.search("(\d+):(\d+)", line)
if match:
duration = int(match.group(1)) * 60 + int(match.group(2))
minutes += duration
print float(minutes) / 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment