随笔分类 -  Python-turtle画图

摘要:源码(详细注释): 1 import turtle # 导入turtle库 2 3 turtle.width(10) # 设置画笔粗细为10 4 turtle.color("blue") # 设置画笔颜色为‘蓝色·’ 5 turtle.circle(50) # 画圆半径为50 6 turtle.pe 阅读全文
posted @ 2021-02-18 18:41 BugMiaowu2021 阅读(813) 评论(0) 推荐(0)
摘要:源码: 1 drawLine(draw) 画一条线 2 drawDight(dight) 画一个数字 3 drawDate(date) 画一组数字 4 import turtle, time 5 6 7 def drawLine(draw): 8 turtle.pendown() if draw e 阅读全文
posted @ 2021-02-17 18:33 BugMiaowu2021 阅读(432) 评论(0) 推荐(0)
摘要:源码: 1 import numpy as np 2 import matplotlib.pyplot as plt 3 import math 4 import mpl_toolkits.mplot3d 5 import tensorflow.compat.v1 as tf 6 tf.disabl 阅读全文
posted @ 2021-02-17 12:45 BugMiaowu2021 阅读(484) 评论(0) 推荐(0)
摘要:源码: 1 import numpy as np 2 import matplotlib.pyplot as plt 3 import math 4 5 6 def normal_distribution(x, mean, sigma): 7 return np.exp(-1 * ((x - mea 阅读全文
posted @ 2021-02-17 11:47 BugMiaowu2021 阅读(300) 评论(0) 推荐(0)
摘要:源码: 1 import turtle 2 class Stack: 3 def __init__(self): 4 self.items = [] 5 def isEmpty(self): 6 return len(self.items) == 0 7 def push(self, item): 阅读全文
posted @ 2021-02-16 13:08 BugMiaowu2021 阅读(177) 评论(0) 推荐(0)
摘要:Python之turtle库画各种有趣的图及源码 基于Python-turtle库绘制皮卡丘、多边形、星空 基于Python-turtle库绘制哆啦A梦 基于Python-turtle库绘制哆啦A梦和大雄在一起 基于Python-turtle库绘制小猪佩奇 Python之turtle画小狗、狮子头和 阅读全文
posted @ 2021-02-16 10:14 BugMiaowu2021 阅读(413) 评论(0) 推荐(0)
摘要:源码: 1 #路飞骷髅 2 import turtle as t 3 #黄底帽子 4 t.pu() 5 t.goto(0,200) 6 t.circle(-130,-80) 7 t.pd() 8 t.colormode(255) 9 t.pensize(5) 10 t.color(242,232,1 阅读全文
posted @ 2021-02-16 10:06 BugMiaowu2021 阅读(1075) 评论(0) 推荐(0)
摘要:源码: 1 #!/usr/bin/env python 2 3 # -*- coding:utf-8 -*- 4 5 import turtle 6 import time 7 8 # 画心形圆弧 9 10 def hart_arc(): 11 12 for i in range(200): 13 阅读全文
posted @ 2021-02-16 10:03 BugMiaowu2021 阅读(1206) 评论(0) 推荐(0)
摘要:源码: 1 import turtle #导入turtle库,turtle库是python的基础绘图库 2 3 turtle.pensize(30) #设置画笔粗细 4 for i in range(30): 5 turtle.circle(i*10,60) #循环画圆30次,每次画60度并且半径增 阅读全文
posted @ 2021-02-16 09:59 BugMiaowu2021 阅读(592) 评论(0) 推荐(0)
摘要:源码 1 from turtle import * 2 import turtle as t 3 t.screensize(500, 500) 4 # 【头部轮廓】 5 t.pensize(5) 6 t.home() 7 t.seth(0) 8 t.pd() 9 t.color('black') 1 阅读全文
posted @ 2021-02-16 09:55 BugMiaowu2021 阅读(3061) 评论(0) 推荐(0)
摘要:源码: 1 import turtle 2 3 4 def getPosition(x, y): 5 turtle.setx(x) 6 turtle.sety(y) 7 print(x, y) 8 9 class Pikachu: 10 11 def __init__(self): 12 self. 阅读全文
posted @ 2021-02-15 19:58 BugMiaowu2021 阅读(662) 评论(0) 推荐(0)
摘要:源码: 1 import turtle 2 3 def drawNose(): 4 turtle.pu() 5 turtle.goto(-100, 100) 6 turtle.pd() 7 turtle.seth(-30) 8 turtle.begin_fill() 9 a=0.4 10 for i 阅读全文
posted @ 2021-02-15 19:52 BugMiaowu2021 阅读(795) 评论(0) 推荐(0)
摘要:源码: 1 # -*- coding: utf-8 -*- 2 3 from turtle import * 4 import turtle 5 6 speed(0) 7 penup() 8 seth(180) 9 fd(200) 10 seth(0) 11 penup() #外圈头 12 circ 阅读全文
posted @ 2021-02-15 19:50 BugMiaowu2021 阅读(371) 评论(0) 推荐(0)
摘要:源码: 1 # -*- coding: utf-8 -*- 2 3 from turtle import * 4 import turtle 5 6 speed(0) 7 penup() 8 seth(180) 9 fd(200) 10 seth(0) 11 penup() #外圈头 12 circ 阅读全文
posted @ 2021-02-15 19:44 BugMiaowu2021 阅读(680) 评论(0) 推荐(0)
摘要:4、动态彩色二维码表白 先在pycharm安装myqr。或者,Python3 必装,然后命令行pip install myqr 也可。 将表白网页:http://sushengbuhuo.gitee.io/love/ 生成二维码,也可以换成其他连接 myqr http://sushengbuhuo. 阅读全文
posted @ 2021-02-14 13:55 BugMiaowu2021 阅读(307) 评论(0) 推荐(0)
摘要:Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。 1、安卓小人 1 #!/usr/bin/env python 2 import 阅读全文
posted @ 2021-02-09 03:35 BugMiaowu2021 阅读(14206) 评论(0) 推荐(0)