スプライン曲線を描く

2017/12/28

Python2.7.8

import Tkinter

def main():

    window = Tkinter.Tk()
    canvas = Tkinter.Canvas(window, bg = "white",width = 300, height = 200)
    canvas.pack()
    #spline
    canvas.create_line(30,30,150,30,150,130,240,140,
                           fill="green",width=3,smooth=True,splinesteps=30)
    #line
    canvas.create_line(30,30,150,30,150,130,240,140,
                           fill="red",width=1)
    window.mainloop()


if __name__ == '__main__':
    main()