Using the example from @Bastian , I tweaked it a little bit to be a little more accurate with small numbers near 0:
## if progress < .5 (half)
# put the "progress" in the background with 2 objects (begin ellipse and rectangle)
# put the "unfinished" part in the foreground with 3 objects (begin ellipse, rectangle, end ellipse)
# make the unfinished begin ellipse get flatter and flatter as it approaches 50%
## if progress >= .5 (half)
# put the "progress" in the foreground with 3 objects (begin ellipse, rectangle, end ellipse)
# put the "unfinished" part in the background with 2 objects (rectangle, end ellipse)
# make the progress end ellipse start flat and get rounder as it approaches 100%
if progress < 0.5:
# draw progress bar
d.ellipse((x, y, x+h, y+h),fill=fg)
d.rectangle((x+(h/2), y, x+w+(h/2), y+h),fill=fg)
# d.ellipse((x+w, y, x+h+w, y+h),fill=fg)
# draw background (unfinished portion)
d.ellipse((x+w, y, x+w+(h*(1-(2*progress))), y+h), fill=bg)
d.rectangle((x+w+(h/2)-(h*progress), y, e+(h/2), y+h), fill=bg)
d.ellipse((e, y, e+h, y+h), fill=bg)
if progress >= 0.5:
# draw background (unfinished portion)
# d.ellipse((x, y, x+h, y+h), fill=bg)
d.rectangle((x+w, y, e+(h/2), y+h), fill=bg)
d.ellipse((e, y, e+h, y+h), fill=bg)
# draw progress bar
d.ellipse((x, y, x+h, y+h),fill=fg)
d.rectangle((x+(h/2), y, x+w+(h*(progress-0.5)), y+h),fill=fg)
d.ellipse((x+w, y, x+w+h*2*(progress-0.5), y+h),fill=fg)
