# -*- coding: utf-8 -*- import tkinter as tk #import tkinter.ttk as ttk root = tk.Tk() root.title("tk41.py") ##################################### ca = tk.Canvas(root, bg = 'lightgreen', relief = 'raised', bd = 5, width = 500, height = 500) ca.pack() line = ca.create_line(0,0, 20,20) t1 = ca.create_text(20,20,text = '文字 Text', anchor = tk.W, fill = 'blue') t2 = ca.create_text(100,20,text = 'Time is money.', anchor = tk.W, fill = 'red', width = 50) t3 = ca.create_text(170,20, text = 'Birds of a feather\nflock together.', anchor = tk.W, fill = 'magenta', font = 'Vijaya 10 bold') ##################################### root.mainloop()