#!/usr/bin/python3 import sys deg = float(sys.argv[1]) m, s = divmod(abs(deg)*3600, 60) d, m = divmod(m, 60) if deg < -1: d = -d d, m = int(d), int(m) print("d:"+str(d)) print("m:"+str(m)) print("s:{:.6f}".format(s));