Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14215

There is a code drawing a heart. How to insert a photo inside this figure so that the remaining background does not change?

$
0
0

There is a code drawing a heart. How to insert a photo inside this figure so that the remaining background does not change?

import timeimport mathimport turtledef xt(t):    return 16 * math.sin(t) ** 3def yt(t):    return 13 * math.cos(t) - 5 * \        math.cos(2 * t) - 2 * \        math.cos(3 * t) - \        math.cos(4 * t)t = turtle.Turtle()turtle.Screen().screensize(1040, 1080)t.speed(1500)turtle.colormode(255)turtle.Screen().bgcolor(0, 0, 0)time.sleep(2)for i in range(300):    t.goto((xt(i) * 20, yt(i) * 20))    t.pencolor((255 - i) % 255, i % 255, (255 + i) // 2 % 255)    t.goto(0, 0)t.hideturtle()turtle.update()turtle.mainloop()

Viewing all articles
Browse latest Browse all 14215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>