7 segments display, highly customizable.
from kandinsky import fill_rect as f def segments(n,x,y,h,c,s): n,bit=str(n),"1110111001001010111011011011011101011010111101111101001011111111111011" for i in range(len(n)): a=int(n[i])*7 if int(bit[a]):f(x+h+i*h*7,y,3*h,h,c) else:f(x+h+i*h*7,y,3*h,h,s) if int(bit[a+1]):f(x+i*h*7,y+h,h,3*h,c) else:f(x+i*h*7,y+h,h,3*h,s) if int(bit[a+2]):f(x+4*h+i*h*7,y+h,h,3*h,c) else:f(x+4*h+i*h*7,y+h,h,3*h,s) if int(bit[a+3]):f(x+h+i*h*7,y+4*h,3*h,h,c) else:f(x+h+i*h*7,y+4*h,3*h,h,s) if int(bit[a+4]):f(x+i*h*7,y+5*h,h,3*h,c) else:f(x+i*h*7,y+5*h,h,3*h,s) if int(bit[a+5]):f(x+4*h+i*h*7,y+5*h,h,3*h,c) else:f(x+4*h+i*h*7,y+5*h,h,3*h,s) if int(bit[a+6]):f(x+h+i*h*7,y+8*h,3*h,h,c) else:f(x+h+i*h*7,y+8*h,3*h,h,s) # Exeample of use : segments("123456789",0,100,5,(255,0,0),(255,)*3)