def ddtodms(self, dd):
        """Take in dd string and convert to dms"""
        negative = dd < 0
        dd = abs(dd)
        minutes,seconds = divmod(dd*3600,60)
        degrees,minutes = divmod(minutes,60)
        if negative:
            if degrees > 0:
                degrees = -degrees
            elif minutes > 0:
                minutes = -minutes
            else:
                seconds = -seconds
        return (degrees,minutes,seconds)
def ddtodms ( self , dd ) : negative = dd < 0 dd = abs ( dd ) minutes , seconds = divmod ( dd * 3600 , 60 ) degrees , minutes = divmod ( minutes , 60 ) if negative : if degrees > 0 : degrees = - degrees elif minutes > 0 : minutes = - minutes else : seconds = - seconds return ( degrees , minutes , seconds )
Take in dd string and convert to dms