converting splits

Former Member
Former Member
Converting back and forth between minutes and seconds to get your splits is tedious, so I wrote a simple python program to do it. Maybe MS excel does it for you, but I wouldn't know, I haven't used any MS products in almost a decade. This will work on a Mac from the shell window (renamed to splits.txt to upload. rename it back to splits.py and make it executable with chmod to run it, but you knew that if you use a Mac, right?) $ cat 500-20080413.txt | ./splits.py 31.88 31.88 1:06.17 34.29 1:40.66 34.49 2:15.71 35.05 2:50.31 34.60 3:24.67 34.36 3:58.76 34.09 4:33.59 34.83 5:08.66 35.07 5:43.08 34.42 ah, I can't get python format strings to work like I'm used to other languages behaving. change __str__ if you want seconds 't get python float format strings to behave. if (self>60): return '%d:%02d.%02d' % (self / 60, self % 60, 100 *((self % 60) - int(self % 60))) else: return '%02d.%02d' % (self % 60, 100 *((self % 60) - int(self % 60)))
Parents Reply Children
No Data