* { margin: 0; padding: 0; } .about { width: 100%; height: 100%; overflow: hidden; } .about_bgc { width: 100% } .about_tit { position: absolute; top: 280px; left: 0; right: 0; font-size: 28px; font-weight: 550; bottom: 0; width: 800px; margin: auto; text-align: center; } .ribbon { display: flex; justify-content: center; position: absolute; right: 300px; top: 50px; margin: auto; } .ribbon:after, .ribbon:before { margin-top: 0.5em; content: ""; display: flex; ; border: 1.5em solid #fff; } .ribbon:after { border-right-color: transparent; } .ribbon:before { border-left-color: transparent; } .ribbon a:link, .ribbon a:visited { color: #000; text-decoration: none; height: 3.5em; overflow: hidden; } .ribbon span { background: #fff; display: inline-block; line-height: 3em; padding: 0 1.5em; margin-top: 0.5em; position: relative; -webkit-transition: background-color 0.2s, margin-top 0.2s; /* Saf3.2+, Chrome */ -moz-transition: background-color 0.2s, margin-top 0.2s; /* FF4+ */ -ms-transition: background-color 0.2s, margin-top 0.2s; /* IE10 */ -o-transition: background-color 0.2s, margin-top 0.2s; /* Opera 10.5+ */ transition: background-color 0.2s, margin-top 0.2s; } .ribbon a:hover span { background: #FFD204; margin-top: 0; } .ribbon span:before { content: ""; position: absolute; top: 3em; left: 0; border-right: 0.5em solid #9B8651; border-bottom: 0.5em solid #fff; } .ribbon span:after { content: ""; position: absolute; top: 3em; right: 0; border-left: 0.5em solid #9B8651; border-bottom: 0.5em solid #fff; } .me { display: flex; justify-content: center; margin-top: 60px; overflow: hidden; } .me_tit { width: 600px; line-height: 36px; font-size: 18px; margin-left: 100px; margin-top: 50px; } .me_img { width: 800px; height: 600px; } .animate { padding-left: 20px; width: 500px; font-size: 16px; color: #000; animation: 10s wordsLoop linear infinite normal; } @keyframes wordsLoop { 0% { transform: translateY(100px); -webkit-transform: translateY(100px); } 100% { transform: translateY(-100%); -webkit-transform: translateY(-100%); } } .videos { display: flex; margin-top: 60px; padding-bottom: 80px; } .videos span { width: 400px; margin-right: 100px; margin-left: 300px; color: #FFD204 }

Python 海龟画图

Python 海龟画图

首先导入海龟画图(import turtle)

基本操作(turtle 英文译为乌龟)

1.turtle.write("wwww") 表示写字符串
2.trutle.forward(300) 前进300像素
3.trutle.color("red") 画笔的颜色改为红色(red可以改为任意颜色 (用英文表示))
4.trutle.left(90) 箭头向右转90度
5.trutle.goto(0,50) 去坐标点(0,50)(以第一个点为0点做直角坐标系)
6.trutle.penup() 抬笔(移动笔时不会出现多余笔画)
7.turtle.pendown() 下笔
8.turtle.circle(100) 画圆(以该点为起点,逆时针画圆)
9.turtle.width(10) 加粗为10

实例 (奥运五环)

import turtle
turtle.width(10)#加粗
turtle.color("blue")#颜色改为蓝色
turtle.circle(50)#画半径为50的圆
turtle.penup()#提笔
turtle.goto(120,0)
turtle.color("black")
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(240,0)
turtle.color("red")
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(60,-50)
turtle.color("yellow")
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(180,-50)
turtle.color("green")
turtle.pendown()
turtle.circle(50)

posted @   #鲁班一号#  阅读(439)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示