turtle
隔壁郑同学
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python turtle绘图-案例集锦(小猪佩奇、哆啦A梦、小黄人、樱花树、皮卡丘、汉诺塔、高达、星空等)
1.小猪佩奇:import turtle as tt.pensize(4)t.hideturtle()t.colormode(255)t.color((255, 155, 192), "pink")t.setup(840, 500)t.speed(20)# 鼻子t.pu()t.goto(-100, 100)t.pd()t.seth(-30)t.begin_fill()a = 0.4for i in range(120): if 0 <= i < 30 or原创 2021-02-14 18:28:03 · 3449 阅读 · 0 评论 -
为2020年的第一场雪锦上添花:用 matplotlib 绘制雪花和雪景
一场大雪,覆盖了华北、华东。天地连成一片,城市银装素裹,处处诗情画意、人人兴高采烈。朋友圈被雪景图和调侃路滑摔跤的段子刷屏,气氛比过年还要热烈几分。我也来凑个热闹,用python为2020年的第一场雪锦上添花。绘制雪花图案,网上有很多文章介绍,但几乎都是用 Python 的内置模块 turtle 绘制的,这个模块适合用来引导孩子学习编程,很难真正用在项目开发上。也有用 pygame 实现的,不过...转载 2020-01-13 21:06:21 · 352 阅读 · 0 评论 -
python3用turtle模块画一棵随机樱花树
import turtle as Timport randomimport time# 画樱花的躯干(60,t)def Tree(branch, t): time.sleep(0.0005) if branch > 3: if 8 <= branch <= 12: if random.randint(0, 2) =...原创 2019-11-04 08:17:20 · 2366 阅读 · 2 评论 -
python画微信表情
#@project = facepalm#@file = main#@author = Maoliang Ran#@create_time = 2018/8/28 22:57 import turtle# 画指定的任意圆弧def arc(sa,ea,x,y,r):#start angle,end angle,circle center,radius turtle.penup(...原创 2019-10-07 08:27:07 · 1649 阅读 · 1 评论 -
python的turtle画图
#画太阳花import turtleimport timeturtle.color('red','yellow')turtle.begin_fill()while True: turtle.forward(200) turtle.left(170) if abs(turtle.pos()) < 1: breakturtle.end_fi...原创 2019-10-03 18:10:14 · 669 阅读 · 0 评论 -
python烟花demo
# -*- coding: utf-8 -*-import math, random, timeimport threadingimport tkinter as tkimport re# import uuidFireworks = []maxFireworks = 8height, width = 600, 600class firework(object): ...原创 2019-09-29 16:25:20 · 3805 阅读 · 0 评论 -
python画炫酷的图
#SquareSpiral1.pyimport turtlet = turtle.Pen()turtle.bgcolor("black")sides=6colors=["red","yellow","green","blue","orange","purple"]for x in range(360): t.pencolor(colors[x%sides]) t.for...原创 2019-09-19 19:17:21 · 7736 阅读 · 2 评论 -
Python中使用turtle库画与女朋友纪念日
import turtle, timedef drawGap(): #绘制数码管间隔 turtle.penup() turtle.fd(5)def drawLine(draw): #绘制单段数码管 drawGap() turtle.pendown() if draw else turtle.penup() turtle.fd(40) draw...原创 2019-09-19 20:39:55 · 631 阅读 · 3 评论 -
python的turtle模拟3d星空图
from turtle import *from random import random,randintscreen = Screen()width ,height = 800,600screen.setup(width,height)screen.title("模拟3D星空")screen.bgcolor("black")screen.mode("logo")screen.d...原创 2019-09-07 15:25:34 · 13939 阅读 · 0 评论 -
python画个哆啦A梦
# * -- utf-8 -- *# Author: Tang import turtle as t t.speed(10)t.pensize(8)t.hideturtle()t.screensize(500, 500, bg='white') # 猫脸t.fillcolor('#00A1E8')t.begin_fill()t.circle(120)t.end_fill...原创 2019-09-08 10:20:37 · 3343 阅读 · 0 评论
分享