本文主要是介绍【春 联---turtle海龟画图】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
春联 又称"春贴"、"门对"、"对联",是过年时所贴的红色喜庆元素"年红"中一个种类。它以对仗工整、简洁箱巧的文字描绘美好形象,抒发美好愿 望,是中国特有的文学形式,是华人们过年 的重要习俗。 贴春联,是中国民间庆祝春节的第一件事情。每当春节将近的时候,家家户户都在大门两边贴上崭新的春联,表达一家一户对新年的美好愿望。因此,认真研究春节时人们张贴的春联,无疑是观察民间风情的一个有意义的途径。
春联的张贴 要符合传统的规矩, 春联要竖贴。 上联要贴在右手边(即门的左边),下联要贴在左手边(即门的右边),横批也是从右往左读的,上下联 不可贴反。
单词
import turtle
#长方形1
turtle.speed(1)
turtle.penup()#抬笔
turtle.goto(-150,150)#移动到点A
turtle.pendown()#落笔
turtle.color("red","red")#选择颜色
turtle.begin_fill()#准备上色
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()#开始上色#长方形2
turtle.speed(2)
turtle.penup()#抬笔
turtle.goto(100,150)#移动到点A
turtle.pendown()#落笔
turtle.color("red","red")
turtle.begin_fill()#准备上色
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.end_fill()
#横批
turtle.speed(3)
turtle.penup()#抬笔
turtle.goto(-110,175)
turtle.pendown()#落笔
turtle.color("red","red")
turtle.begin_fill()#准备上色
turtle.forward(60)
turtle.right(90)
turtle.forward(220)
turtle.right(90)
turtle.forward(60)
turtle.right(90)
turtle.forward(220)
turtle.right(90)
turtle.end_fill()#开始上色
turtle.done()#结束
给图形上色
turtle .write ( “arg”, align="center”, font =( ”宋体”,8 , normal")) • arg —书写的文字,格式必须是字符串 • align —对齐方式,字符串"left”,“center”或 “right” • font —字体,三元组(字体名称,字体大小,字体类型(默认常规字形))turtle ・ write ( ”内容”,align = "center" , font =("宋体",8 , "normal"))
turtle. write("—年四季春常在",align="center", font=("华文行楷",8))
turtle.write("—\n年\n四\n季\n春\n常\n在",align="center", font=("华文行楷",40))
import turtle
#长方形1
turtle.speed(1)
turtle.penup()#抬笔
turtle.goto(-150,150)#移动到点A
turtle.pendown()#落笔
turtle.color("red","red")#选择颜色
turtle.begin_fill()#准备上色
turtle.forward(50)#前进50
turtle.right(90)#右转90度
turtle.forward(400)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()#开始上色#长方形1的文字
turtle.penup()
turtle.goto(-150,-250)
turtle.pendown()
turtle.color("black")
turtle.write("万\n紫\n千\n红\n花\n永\n开",font=("华文行楷",40))#长方形2
turtle.speed(2)
turtle.penup()#抬笔
turtle.goto(100,150)#移动到点A
turtle.pendown()#落笔
turtle.color("red","red")
turtle.begin_fill()#准备上色
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.end_fill()
#长方形2的文字
turtle.penup()
turtle.goto(125,-250)
turtle.pendown()
turtle.color("black")
turtle.write("一\n年\n四\n季\n春\n常\n在",align="center",font=("宋体",40))#横批
turtle.speed(3)
turtle.penup()#抬笔
turtle.goto(-110,175)
turtle.pendown()#落笔
turtle.color("red","red")
turtle.begin_fill()#准备上色
turtle.forward(60)
turtle.right(90)
turtle.forward(220)
turtle.right(90)
turtle.forward(60)
turtle.right(90)
turtle.forward(220)
turtle.right(90)
turtle.end_fill()#开始上色
turtle.color("black")
turtle.write("春新迎喜",align="left",font=("简体",40))
turtle.done()#结束
# -*- coding: utf-8 -*-
import turtle
turtle.speed(1)
turtle.penup()
turtle.goto(-150,150)
turtle.pendown()
turtle.color("red","red")
turtle.begin_fill()
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()turtle.penup()
turtle.goto(-150,-250)
turtle.pendown()
turtle.color("black")
turtle.write("万\n紫\n千\n红\n花\n永\n开",font=("华文行楷",40))turtle.penup()
turtle.goto(100,150)
turtle.pendown()
turtle.color("red","red")
turtle.begin_fill()
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(400)
turtle.end_fill()turtle.penup()
turtle.goto(125,-250)
turtle.pendown()
turtle.color("black")
turtle.write("一\n年\n四\n季\n春\n常\n在",align="center",font=("华文行楷",40))turtle.penup()
turtle.goto(-110,175)
turtle.pendown()
turtle.color("red","red")
turtle.begin_fill()
turtle.forward(60)
turtle.right(90)
turtle.forward(220)
turtle.right(90)
turtle.forward(60)
turtle.right(90)
turtle.forward(220)
turtle.right(90)
turtle.end_fill()
turtle.color("black")
turtle.write("春新迎喜",align="left",font=("华文行楷",40))
turtle.done()
这篇关于【春 联---turtle海龟画图】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!