Commit e8205958 by BellCodeEditor

auto save

parent 2a16472e
Showing with 8 additions and 4 deletions
import turtle # 导入turtle模块
# 背景颜色
screen = turtle.Screen() # 取出画布背景并赋值给变量Screen
screen.bgcolor("light blue") # 改变背景颜色为blue
# 写字
# pen=turtle.Pen() # 创建画笔,调用turtle模块.Pen方法首字母大写
pen = turtle.Pen() # 创建画笔Pen
pen.penup() # 抬起画笔
pen.goto(100,-100) # 将文字画笔移至爱心右下角位置
# 用write()方法将内容写在画布上,参1书写内容(\n换行)参2字体名称大小类型赋值给font(元组)
# pen.write("诺依,\nturtle真好用,\n我会在画布上写字了",font=("Times",30,"normal"))
# pen.hideturtle() # 调用hideturtle()方法隐藏画笔
# turtle.done() # 保存画布
pen.write("诺依,\nturtle真好用,\n我会在画布上写字了",font=("Times",15,"normal"))
pen.hideturtle() # 调用hideturtle()方法隐藏画笔
# 画爱心
pen1 = turtle.Pen() # 新建画笔Pen1
pen1.pencolor("red") # 设置线条的颜色
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment