キャンバスに線を描く

2018/02/11

Python2.7.8

# -*- coding: utf-8 -*-

import Tkinter

def main():

    window = Tkinter.Tk()
    canvas = Tkinter.Canvas(window, bg = "white",
                            width = 300, height = 200)
    canvas.pack()

    canvas.create_line(30,30,150,30,150,130,240,140,fill="red",width=1)

    window.mainloop()

if __name__ == '__main__':
    main()


Tkinter 8.5 reference: a GUI for Python 8.10. Canvas line objects
https://infohost.nmt.edu/tcc/help/pubs/tkinter/web/create_line.html