用python制作贺卡_使用Python创作自己的圣诞节动图贺卡,制作简单即刻生成

本文介绍了如何使用Python 3制作一个无依赖的圣诞节动图贺卡,通过简单的代码修改,即可定制个性化的祝福语,为亲朋好友送上特别的节日问候。
摘要由CSDN通过智能技术生成

引言

圣诞节就在眼前,怎样诚挚表达自己的心意呢,自己动手做一个定制动图贺卡,写上定制的祈福语,收到贺卡的人一定很开心。

干货

废话不多说,直接上源代码。Python 3环境直接运行,无任何依赖。 修改代码中的祝福语字段,就可以定制你自己的动图贺卡了。

# -*- coding: utf-8 -*-

from turtle import *

from random import randint

def create_rectangle(turtle, color, x, y, width, height):

turtle.penup()

turtle.color(color)

turtle.fillcolor(color)

turtle.goto(x, y)

turtle.pendown()

turtle.begin_fill()

turtle.forward(width)

turtle.left(90)

turtle.forward(height)

turtle.left(90)

turtle.forward(width)

turtle.left(90)

turtle.forward(height)

turtle.left(90)

turtle.end_fill()

turtle.setheading(0)

def create_circle(turtle, x, y, radius, color):

oogway.penup()

oogway.color(color)

oogway.fillcolor(color)

oogway.goto(x, y)

oogway.pendow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值