# -*- coding: utf-8 -*- import tkinter as tk import tkinter.ttk as ttk #from tkinter import font #from tkinter import filedialog root = tk.Tk() root.title("tk35.py") ##################################### ca = tk.Canvas(root, bg = 'lightgreen', relief = 'raised', bd = 5, width = 500, height = 500) ca.pack() line = ca.create_line(10,10,100,100, 100, 50, fill = 'blue', width = 5, arrow = tk.BOTH, arrowshape = (8,10,8)) line1 = ca.create_line(20,20, 120, 20, fill = 'black', dash = (5,)) line2 = ca.create_line(30, 30, 130, 30, fill = 'red', dash = (5, 1, 1, 1), width = 5) line3 = ca.create_line(40, 40, 140, 40, fill = 'white', dash = (7, 2, 2), width = 5) x0 = 250 y0 = 250 length = 2 for i in range(1, 61, 4): x1 = x0+length*i ca.create_line(x0, y0, x1, y0) x0 = x1 y1 = y0-length*(i+1) ca.create_line(x0, y0, x1, y1) x1 = x0 - length*(i+2) y0 = y1 ca.create_line(x0, y0, x1, y1) x0 = x1 y1 = y0 + length*(i+3) ca.create_line(x0, y0, x1, y1) x0 = x1 y0 = y1 ##################################### root.mainloop()