Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson3-4-1_DIY1

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson3-4-1_DIY1
  • 1.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 7935e660
    BellCodeEditor committed 3 years ago
    7935e660
1.py 640 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
import turtle
pen1 = turtle.Pen()
pen1.penup()
pen1.goto(100,-100)
# \n 换行
pen1.write("温暖的灵魂终将相遇",
            font=("Times",10,"normal"))
# 拿画笔
pen = turtle.Pen()
# 拿背景
screen = turtle.Screen()
# 设置背景颜色 #值=(1-9 a-f) 6位 3位  adf = aaddff
screen.bgcolor("#abcdef")
# 设置画笔颜色
pen.color("red")
# 设置画笔粗细
pen.pensize(10)
# 画爱心
pen.left(45)
# 正方形边长为圆的直径:2*len
# fd = forword
pen.fd(100)
pen.circle(50,180)
pen.right(90)
pen.circle(50,180)
pen.fd(100)
# 隐藏画笔
pen.hideturtle()
# 保留画布
turtle.done()