-
2020-12-05 01:15:56
{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":10,"count":10}]},"card":[{"des":"刷脸门禁通行系统前端接入人脸AI赋能的人脸识别门禁机,系统能够提供基于人脸One -ID的人员管理、识别比对、智慧通行、轨迹记录、人脸搜索等服务,满足用户对效率提升、安保服务先进可靠的诉求。","link1":"https://linkmarket.aliyun.com/pp/application/detail?spm=a2c3t.12428491.appk_chosen_app.16.2ccb51e7TwbnTV&commodityId=2090&commodityType=software","link":"https://linkmarket.aliyun.com/pp/application/detail?spm=a2c3t.12428491.appk_chosen_app.16.2ccb51e7TwbnTV&commodityId=2090&commodityType=software","icon":"https://img.alicdn.com/tfs/TB1UX8wc7xz61VjSZFrXXXeLFXa-200-200.png","btn2":"查看更多","tip":"人脸识别系统","btn1":"立即购买","link2":"https://linkmarket.aliyun.com/pp/application?spm=a2c3t.11219569.iot-navBar.61.5dc551e7p53Dqj","title":"FacePass智慧空间人脸识别综合解决方案"}],"search":[{"txt":"物联网应用中心","link":"https://linkmarket.aliyun.com/pp/application?source=neibu_aliyunguanwang"},{"txt":"分销商招募","link":"https://linkmarket.aliyun.com/tms/distributor?source=neibu_aliyunguanwang"},{"txt":"物联网设备接入","link":"https://www.aliyun.com/product/iot-deviceconnect?source=neibu_aliyunguanwang"},{"txt":"物联网络管理平台","link":"https://iot.aliyun.com/products/linkwan?source=neibu_aliyunguanwang"},{"txt":"物联网设备管理","link":"https://www.aliyun.com/product/iot-devicemanagement?source=neibu_aliyunguanwang"},{"txt":"物联网应用开发","link":"https://iot.aliyun.com/products/iotstudio?source=neibu_aliyunguanwang"},{"txt":"物联网边缘计算","link":"https://iot.aliyun.com/products/linkedge?source=neibu_aliyunguanwang"},{"txt":"物联网设备身份认证","link":"https://iot.aliyun.com/products/ID2?source=neibu_aliyunguanwang"},{"txt":"物联网数据分析","link":"https://www.aliyun.com/product/iot-dataanalytics?source=neibu_aliyunguanwang"},{"txt":"物联网解决方案","link":"https://linkmarket.aliyun.com/search?source=neibu_aliyunguanwang"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}}}
{"$env":{"JSON":{}},"$page":{"env":"production"},"$context":{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":10,"count":10}]},"card":[{"des":"刷脸门禁通行系统前端接入人脸AI赋能的人脸识别门禁机,系统能够提供基于人脸One -ID的人员管理、识别比对、智慧通行、轨迹记录、人脸搜索等服务,满足用户对效率提升、安保服务先进可靠的诉求。","link1":"https://linkmarket.aliyun.com/pp/application/detail?spm=a2c3t.12428491.appk_chosen_app.16.2ccb51e7TwbnTV&commodityId=2090&commodityType=software","link":"https://linkmarket.aliyun.com/pp/application/detail?spm=a2c3t.12428491.appk_chosen_app.16.2ccb51e7TwbnTV&commodityId=2090&commodityType=software","icon":"https://img.alicdn.com/tfs/TB1UX8wc7xz61VjSZFrXXXeLFXa-200-200.png","btn2":"查看更多","tip":"人脸识别系统","btn1":"立即购买","link2":"https://linkmarket.aliyun.com/pp/application?spm=a2c3t.11219569.iot-navBar.61.5dc551e7p53Dqj","title":"FacePass智慧空间人脸识别综合解决方案"}],"search":[{"txt":"物联网应用中心","link":"https://linkmarket.aliyun.com/pp/application?source=neibu_aliyunguanwang"},{"txt":"分销商招募","link":"https://linkmarket.aliyun.com/tms/distributor?source=neibu_aliyunguanwang"},{"txt":"物联网设备接入","link":"https://www.aliyun.com/product/iot-deviceconnect?source=neibu_aliyunguanwang"},{"txt":"物联网络管理平台","link":"https://iot.aliyun.com/products/linkwan?source=neibu_aliyunguanwang"},{"txt":"物联网设备管理","link":"https://www.aliyun.com/product/iot-devicemanagement?source=neibu_aliyunguanwang"},{"txt":"物联网应用开发","link":"https://iot.aliyun.com/products/iotstudio?source=neibu_aliyunguanwang"},{"txt":"物联网边缘计算","link":"https://iot.aliyun.com/products/linkedge?source=neibu_aliyunguanwang"},{"txt":"物联网设备身份认证","link":"https://iot.aliyun.com/products/ID2?source=neibu_aliyunguanwang"},{"txt":"物联网数据分析","link":"https://www.aliyun.com/product/iot-dataanalytics?source=neibu_aliyunguanwang"},{"txt":"物联网解决方案","link":"https://linkmarket.aliyun.com/search?source=neibu_aliyunguanwang"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}}}}
更多相关内容 -
Python turtle画图-史迪仔
2018-11-19 11:43:07使用python turtle库实现了动漫人物史迪仔的绘制,画图过程尽量细分将每一个拐角都反复调整角度,直到合适为止,大概耗费了五六个小时的时间绘制成功 -
Python turtle画图_python画人物_datedvv_python画动漫_Python史迪奇_CartoonPy_
2021-10-01 11:47:27使用python turtle库实现了动漫人物史迪仔的绘制,画图过程尽量细分将每一个拐角都反复调整角度,直到合适为止,大概耗费了五六个小时的时间绘制成功 -
Python Turtle 画图:黑洞里的繁星(附源代码)
2022-07-13 12:46:26本文就介绍如何利用Turtle 绘画浩瀚宇宙黑洞里的繁星,Turtle是python一个简单好用的绘图包,它可以通过设计坐标来实时控制绘图,易学易用。让我们一起去看星星,体现宇宙与计算机之美。...............仰望星空,总想看到不一样的星辰。本文就介绍如何利用Turtle 绘画浩瀚宇宙黑洞里的繁星,Turtle是python一个简单好用的绘图包,它可以通过设计坐标来实时控制绘图,易学易用。让我们一起去看星星,体现宇宙与计算机之美。
目录
前言
"天高地迥,觉宇宙之无穷" 人在宇宙,好像太空中一粒沙子那么渺小。 仰望星空,总想看到不一样的星辰。本文就介绍如何利用Python Turtle 绘画浩瀚宇宙黑洞里的繁星,体现宇宙与计算机之美,让我们一起去看星星。
一、Python Turtle是什么?
turtle是python一个简单好用的绘图包,它可以通过设计坐标来实时控制绘图。安装很简单,一行命令:
pip install turtle
二、绘图步骤
1.引入库
import turtle as t import random
2. 创建画板,画笔和颜色
t.setup(800,600) t.colormode(255) t.bgcolor('lavender') t.speed(0) colorlist=['silver','lightgoldenrodyellow','floralwhite', 'slategrey','lightsteelblue','pink'] colorback=['lavender','lightsteelblue'] randomColor=['pink','lavender','lightsteelblue','silver', 'lightgoldenrodyellow','floralwhite','slategrey'] angle=60
3.绘画大星星
3.1 随机效果图如下:
3.2 源代码如下:
#画大星星 def drawFiveStar (x,y,angle,step,color): t.penup() t.goto(x,y) t.left(angle) t.pendown() t.color(color) t.fillcolor(color) t.begin_fill() for x in range(5): t.forward(step) t.right(144) t.end_fill() for i in range(50): step=random.randint(20,40) x=random.randint(-400,400) y=random.randint(0,300) angle=random.randint(0,36)*10 color=random.choice(colorlist) drawFiveStar(x,y,angle,step,color)
4. 绘画小繁星
4.1 随机效果图如下:
4.2 源代码如下:
#画小星星 for j in range (200): back1 =random.choice(colorback) t.bgcolor(back1) temp1 =random.choice(colorlist) t.fillcolor(temp1) t.color(temp1) t.begin_fill() temp2 =random.randint(5,15) li2= [5,7,9] temp3= random.choice(li2) for i in range (temp3): t.forward(temp2) t.left(180-180/temp3) t.end_fill() t.hideturtle() t.penup() for k in range(2): t.left(random.randint(10,120)) t.forward(random.randint(10,50))
5. 画黑洞
5.1 随机效果图如下:
5.2 源代码如下:
#画黑洞 for i in range(600): t.color(randomColor[i%6]) t.fd(i) t.rt(angle+1)
三 、黑洞里的繁星效果图
随机效果展示
四、附上完整源代码
# -*- coding: utf-8 -*- """ Created on Wed Jul 13 09:03:32 2022 @author: Margaret Wong """ import turtle as t import random t.setup(800,600) t.colormode(255) t.bgcolor('lavender') t.speed(0) colorlist=['silver','lightgoldenrodyellow','floralwhite', 'slategrey','lightsteelblue','pink'] colorback=['lavender','lightsteelblue'] randomColor=['pink','lavender','lightsteelblue','silver', 'lightgoldenrodyellow','floralwhite','slategrey'] angle=60 #画大星星 def drawFiveStar (x,y,angle,step,color): t.penup() t.goto(x,y) t.left(angle) t.pendown() t.color(color) t.fillcolor(color) t.begin_fill() for x in range(5): t.forward(step) t.right(144) t.end_fill() for i in range(50): step=random.randint(20,40) x=random.randint(-400,400) y=random.randint(0,300) angle=random.randint(0,36)*10 color=random.choice(colorlist) drawFiveStar(x,y,angle,step,color) t.up() t.goto(0,0) t.pendown() #画小星星 for j in range (200): back1 =random.choice(colorback) t.bgcolor(back1) temp1 =random.choice(colorlist) t.fillcolor(temp1) t.color(temp1) t.begin_fill() temp2 =random.randint(5,15) li2= [5,7,9] temp3= random.choice(li2) for i in range (temp3): t.forward(temp2) t.left(180-180/temp3) t.end_fill() t.hideturtle() t.penup() for k in range(2): t.left(random.randint(10,120)) t.forward(random.randint(10,50)) t.up() t.goto(0,0) t.pendown() t.color('purple') t.goto(0,0) t.down() t.bgcolor('black') #画黑洞 for i in range(600): t.color(randomColor[i%6]) t.fd(i) t.rt(angle+1) t.penup() t.color('white') t.goto(0,0) t.down() t.done()
总结
以上就是今天要讲的内容,本文简单介绍了turtle的使用实例,展示如何使用turtle函数绘画不一样的美。
-
python 实现turtle画图并导出图片格式的文件
2021-01-20 03:59:29from turtle import* import turtle setup(800,700,300,50) penup() seth(90) fd(100) seth(0) fd(-200) pendown() pensize(3) pencolor(black) seth(0) fd(210) seth(90) fd(20) seth(115) circle(120,129) seth... -
python turtle 画图
2021-07-04 19:50:35樱花-python 1.导入库 2.基本框架 3.定义花瓣和树主干的函数 import turtle import time import random t = turtle.Turtle() w = turtle.Screen() t.up() t.left(90) t.backward(200) t.down() w.screensize(bg='...樱花-python
1.导入库
2.基本框架
3.定义花瓣和树主干的函数import turtle import time import random t = turtle.Turtle() w = turtle.Screen() t.up() t.left(90) t.backward(200) t.down() w.screensize(bg='wheat') t.color('sienna') def petal(times,t): for i in range(times): a = 200 - 400 * random.random() b = 10 - 20 * random.random() print(a,b) t.up() t.forward(b) t.left(90) t.forward(a) t.down() t.color('lightcoral') t.circle(1) t.up() t.backward(a) t.right(90) t.backward(b) t.down() def body_draw(branchlen,t): time.sleep(0.005) if branchlen >3: if 8<=branchlen<=12: if random.randint(0,2) == 0: t.color('snow') else: t.color('lightcoral') t.pensize(branchlen / 3) elif branchlen < 8: if random.randint(0,1) == 0: t.color('snow') else: t.color('lightcoral') t.pensize(branchlen / 2) else: t.color('sienna') t.pensize(branchlen / 10) t.forward(branchlen) a = 1.5 * random.random() t.right(20 * a) b = 1.5 * random.random() body_draw(branchlen - 10 * b,t) t.left(40 * a) body_draw(branchlen - 10 * b,t) t.right(20 * a) t.up() t.backward(branchlen) t.down() body_draw(60,t)
-
python turtle画图
2022-03-18 18:17:35python ''' Turtle是一种渲染器,和窗体程序 .表示成员访问号 ''' import turtle DISTANCE = 100 # 1 设置画布大小 (600,600,"red") 宽 高 背景颜色 #turtle.screensize(800,600) # 2设置起始坐标 (0,0) 左上...一 基本命令
二 具体案例
python
''' Turtle是一种渲染器,和窗体程序 .表示成员访问号 ''' import turtle DISTANCE = 100 # 1 设置画布大小 (600,600,"red") 宽 高 背景颜色 #turtle.screensize(800,600) # 2设置起始坐标 (0,0) 左上角 (x,y) 用得比较多,也可以设置画布大小 turtle.setup(800,600,0,0) # 3 turtle设置快慢 0到100 速度增加 turtle.speed(1) turtle.pendown() # 4 画迷宫 # for i in range(4*10): # turtle.forward(10*i) # turtle.right(90) # 5 画圆心 半径为正,画笔左边,画笔右边画园 turtle.circle(50) turtle.circle(-50) # 6 turtle.color("red","green") 画笔自己颜色和填充颜色 turtle.color("red", "green") turtle.begin_fill() turtle.circle(-50) turtle.end_fill() turtle.fillcolor("red") # 表示所有工作都已经做完了; 让窗体保持运行状态 turtle.done() print("hello world") def do(): pass if __name__=="__main__": do()
-
python turtle画图部分图像显示后又瞬间消失,一直不显示
2022-01-19 17:15:08问题遇到的现象和发生背景 图像画的过程中一段时间可以显示,但又突然消失,一直不显示,完整的图像应该是y=1/x的图像 部分代码 import turtle bili = 30.0 jiange = 1 turtle.pensize(1) turtle.hideturtle() ... -
Python turtle随机画图程序
2021-08-22 19:21:12Python turtle随机画图程序 -
Python使用turtle画图
2021-12-02 00:16:33Python使用turtle画图 -
Python turtle画图
2020-11-20 20:32:24Python turtle画图所属分类:绘图程序开发工具:Python文件大小:2KB下载次数:1上传日期:2020-05-23 00:41:12上 传 者:wangxueliang1235说明: 使用python turtle库实现了动漫人物史迪仔的绘制,画图过程尽量细分... -
Python turtle画图怎么填充颜色
2021-10-22 12:57:49我用代码画出来一个爱心,fillcolor也输了怎么填充不了颜色 -
PYTHON:turtle函数详解 ,turtle画图完整代码
2022-03-29 23:10:30turtle画图及相关函数 -
Python海龟turtle画图常见画图代码大全
2021-09-05 22:22:27import turtle # 设置初始位置 turtle.penup() # 提起画笔 turtle.left(90) # 逆时针旋转九十度 turtle.fd(200) # 向前移动一段距离 fd=forward turtle.pendown() # 放下画笔移动画笔开始绘制 turtle.right(90) # ... -
Python turtle画图问题
2021-09-30 06:29:22要求画这样的图形,要求用for循环,要怎么写,写了好多,完全不知道怎么搞。 -
python turtle库画图(有源码)
2022-02-06 13:57:22turtle是python自带的画图函数库,功能十分强大。 -
【python turtle画图】太极图绘制实例
2022-04-19 11:00:16turtle 画图,使用Python画出太极阴阳八卦图的代码 # -*- coding: utf-8 -*- import turtle as t # 设置背景和笔的移动速度及大小 t.bgcolor('yellow') t.speed(10) t.pensize(6) # 画黑色的半圆 t.fillcolor(... -
Python Turtle 画图
2019-01-26 21:45:00Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形... -
蓝桥杯Python初级组测试题之Turtle画图
2022-03-20 16:33:47蓝桥杯Python测试题之Turtle画图 -
python turtle库练习 讲解
2020-04-10 16:41:16python turtle库练习 讲解 大家可以一起学习 练习 快来下载吧 学习 吧 turtle库实现画圆 各种图案 -
python 用turtle画图运行报错、大佬门帮我看看
2021-01-18 19:13:17from turtle import * from time import sleep def go_to(x, y): up() goto(x, y) down() def head(x, y, r): go_to(x, y) speed(1) circle(r) leg(x, y) def leg(x, y): right(90) forward(180) ... -
Python:使用Python turtle画图时,画完图形窗口一下子消失,退出窗口的几个解决方法
2020-05-10 11:13:061.第一种方法:在程序的最后面加上:turtle.exitonclick() 该语句让程序等待用户点击界面后才能够退出 2.第二种方法:在程序的最后面加上:turtle.mainloop() 该语句必须放到最后一句,该句子后面的所有代码都... -
10分钟轻松学会 Python turtle 绘图
2021-03-17 14:38:5810分钟轻松学会 Python turtle 绘图python2.6版本中后引入的一个简单的绘图工具,叫做海龟绘图(Turtle Graphics),turtle库是python的内部库,使用导入即可import turtle先说明一下turtle绘图的基础知识:1. 画布... -
使用Python turtle画图时,画完图形窗口一下子消失,退出窗口的几个解决方法
2020-03-22 09:09:20使用Python turtle画图时,画完图形窗口一下子退出消失怎么办,如何能够停留在画完的窗口呢?退出窗口的几个解决方法 程序退出画图界面的原因,本质上来说就是程序执行完成了,程序自然会退出。只要我们能够想办法...