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

bellcode / lesson3-1-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
Commit b6bc4b28 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 169bf176
Hide whitespace changes
Inline Side-by-side
Showing with 11 additions and 6 deletions
  • diy1.py
diy1.py
View file @ b6bc4b28
#利用write()帮助悟空给诺依回信吧~ #利用write()帮助悟空给诺依回信吧~
import turtle import turtle
import random
#创建画笔 #创建画笔
pen = turtle.Pen() pen = turtle.Pen()
screen=turtle.Screen()
list=["green","blue","gold","pink","black","red"]
screen.bgcolor(random.choice(list))
size=int(screen.textinput("aaa","大小"))
#写字 #写字
pen.write(' 《红豆》\n红豆生南国,\n春来发几枝。\n愿君多采撷,\n此物最相思。',font=('黑体',30,'normal')) pen.write(' 《红豆》\n红豆生南国,\n春来发几枝。\n愿君多采撷,\n此物最相思。',font=('黑体',30,'normal'))
pen.penup() pen.penup()
pen.goto(-100,0) pen.goto(-100,0)
pen.pendown() pen.pendown()
pen.color("gold") pen.color(random.choice(list))
pen.pensize(3) pen.pensize(3)
pen.fillcolor("red") pen.fillcolor(random.choice(list))
pen.begin_fill() pen.begin_fill()
pen.lt(45) pen.lt(45)
pen.fd(100) pen.fd(size*2)
pen.circle(50,180) pen.circle(size,180)
pen.right(90) pen.right(90)
pen.circle(50,180) pen.circle(size,180)
pen.fd(100) pen.fd(size*2)
pen.end_fill() pen.end_fill()
pen.hideturtle() pen.hideturtle()
#保存画布 #保存画布
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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