To solve your problem, you can first use split lines at vertice tool to explose your polyline to segment. The following step is to use this script on the calculate field:
Now you have angle for each line in the new feature class.
radian = math.atan((shape.lastpoint.x - shape.firstpoint.x)/(shape.lastpoint.y - shape.firstpoint.y))
degrees = radian * 180 / math.pi
Hope that help you,