Just trying to write a function that gets clock hand angles, but getting an error where i try to create an empty list. It has worked on other scripts previously without any issues.
def gethandpos():
now=datetime.datetime.now()
datetime.time(now.hour,now.minute,now.second)
m=float(now.minute+now.second/60)
h=float(now.hour+(m/60))
hangle=math.fabs(((h*360)/12)-90)
mangle=math.fabs(((m*360)/60)-90)
sangle=(math.fabs((float((now.second*360)/60))-90)
coords=[]
coords.append((math.cos(math.radians(sangle)),math.sin(math.radians(sangle))))
coords.append((math.cos(math.radians(mangle)),math.sin(math.radians(mangle))))
coords.append((math.cos(math.radians(hangle)),math.sin(math.radians(hangle))))
print coords
output:
coords=[]
^
syntax error: invalid syntax
what am I doing wrong?
1 Answer