python好看的流星雨代码

2024-01-13 12:16:26   文档大全网     [ 字体: ] [ 阅读: ]

#文档大全网# 导语】以下是®文档大全网的小编为您整理的《python好看的流星雨代码》,欢迎阅读!
流星雨,好看,代码,python
python好看的流星雨代码



import random import turtle

wn = turtle.Screen()

wn.setup(width = 800, height = 600) wn.bgcolor('black') wn.title('流星雨')

pen = turtle.Turtle() pen.shape('circle') pen.penup()

for _ in range(60):

pen.goto(random.randint(0, 800), random.randint(0, 600)) pen.color('white') pen.pendown()

pen.fd(random.randint(50, 100)) pen.penup()

turtle.done()


本文来源:https://www.wddqxz.cn/7c318989c2c708a1284ac850ad02de80d4d806e7.html

相关推荐