2 # transforms a degree notation like
3 # 43:36:56.32 (43 degrees 36 minutes 56.32 seconds)
4 # into a decimal notation
8 pattern="^(-*\d+):(\d+):([\d\.]+)$"
9 matcher=re.compile(pattern)
14 def translate (coord):
15 r=matcher.match(coord)
17 print('failed to parse',coord,'pattern=',pattern)
19 (deg,min,sec)=list(map(float,r.groups()))
20 # print 'deg',deg,'min',min,'sec',sec
22 print(coord,'->',deg+min*minute+sec*second)
24 print(coord,'->',deg-min*minute-sec*second)
28 for arg in sys.argv[1:]:
31 if __name__ == '__main__':