import math r = 20 base = 0.5 spd = 4000.0 print("G28") print("G1 Z%f F%f" % (base,spd)) for h in range(20): z = base + h*0.1 for theta in range(360): rad = (theta*math.pi/180.0) x = r*math.cos(rad) y = r*math.sin(rad) print("G1 X%f Y%f Z%f F3000" % (x,y,z))