Рейтинг  

Яндекс.Метрика
Яндекс цитирования
 

   

Статистика  

Пользователи
7
Материалы
576
Кол-во просмотров материалов
2740735
   

Рисунок с использованием двух библиотек Tkinter и Turtle:

from tkinter import *
from turtle import *

w = 900
h = 600
hx = 50
hy = -50
sd = 100

#win = Tk()
#can = Canvas(win, width=w, height=h, bg="Beige")
can = getcanvas() #turtle.getcanvas()
win = can.master
win.geometry(f'{w}x{h}')
can.configure(width=w, height=h, bg="Beige")

dom = can.create_rectangle((hx, hy), (hx + 350, hy + 250), fill='lightblue')
okno = can.create_rectangle((hx + 50, hy + 50), (hx + 300, hy + 200), fill='white')
can.create_line((hx + 175, hy + 50), (hx + 175, hy + 200), width=2)
can.create_line((hx + 50, hy + 125), (hx + 300, hy + 125), width=2)
roof_points = [(hx - 30, hy), (hx + 175, hy - 150), (hx + 380, hy)]
roof = can.create_polygon(roof_points, outline='green', fill='orange', width=2)
can.create_oval(hx - 250, hy + 50, hx - 250 + sd, hy + 50 + sd, fill='lightgreen')
can.create_oval(hx - 220, hy + 30, hx - 220 + sd, hy + 30 + sd, fill='lightgreen')
can.create_oval(hx - 190, hy + 50, hx - 190 + sd, hy + 50 + sd, fill='lightgreen')
can.create_oval(hx - 220, hy + 80, hx - 220 + sd, hy + 80 + sd, fill='lightgreen')
trava = can.create_rectangle((-(w // 2), hy + 250), (w // 2, hy + 280), fill='green')
stvol = can.create_rectangle((hx - 180, hy + 180), (hx - 165, hy + 250), fill='brown')
steb = can.create_rectangle((hx - 380, hy + 200), (hx - 365, hy + 250), fill='green')

tracer(0)
penup()
goto(-400, 150)
#setpos(-300, 150)
pendown()
#left(150)
#up(100)
color('red', 'yellow')
begin_fill()
for i in range(40):
    forward(200)
    left(170)
end_fill()

penup()
goto(-350, -170)
#setpos(-300, 100)
pendown()
tracer(2)
color('darkgreen', 'yellow')
left(135)
begin_fill()
for i in range(9):
    left(45)
    for k in range(2):
        for m in range(45):
            forward(2)
            right(2)
        left(90)
    right(180)
end_fill()


can.pack()
done()

mainloop()


Проект Веры

   
   

Login Form