import tkinter as tk root = tk.Tk() root.title( '林心憲模仿教育學習網' ) root.geometry( '300x300' ) canvas = tk.Canvas(root, width = 300 , height = 300 ) canvas.create_rectangle( 10 , 10 , 50 , 100 ) canvas.create_rectangle( 60 , 10 , 110 , 100 , width = 8 ) canvas.create_rectangle( 120 , 10 , 170 , 100 , width = 8 , fill = '#f00' ) canvas.create_rectangle( 180 , 10 , 230 , 100 , width = 8 , fill = '#f00' , outline = '#00f' ) canvas.create_rectangle( 240 , 10 , 290 , 100 , width = 3 , fill = '#fff' , outline = '#0a0' , dash = ( 5 , 5 )) canvas.create_oval( 210 , 120 , 250 , 160 , width = 3 , fill = '#fff' , outline = '#0a0' , dash = ( 5 , 5 )) canvas.create_text( 40 , 110 , text = 'Yeeeeee' , anchor = 'nw' , fill = '#0a0' , font = ( 'Arial' , 30 , 'bold' , 'italic' , 'underline' )) canvas.pack() root.mainloop() frame框架, width, height, src=source
留言
張貼留言