-
python代码画皮卡丘_跟我学python(7)——turtle画皮卡丘
2020-11-25 17:09:54from turtle import *'''绘制皮卡丘头部'''def face(x,y): """画脸""" begin_fill() penup() # 将海龟移动到指定的坐标 goto(x, y) pendown() # 设置海龟的方向 setheading(40) circle(-150, 69) fillcolor("#...python7-0
今天我们的任务是画一只可爱的皮卡丘!开始编程吧!
from turtle import *
'''
绘制皮卡丘头部
'''
def face(x,y):
"""画脸"""
begin_fill()
penup()
# 将海龟移动到指定的坐标
goto(x, y)
pendown()
# 设置海龟的方向
setheading(40)
circle(-150, 69)
fillcolor("#FBD624")
# 将海龟移动到指定的坐标
penup()
goto(53.14, 113.29)
pendown()
setheading(300)
circle(-150, 30)
setheading(295)
circle(-140, 20)
print(position())
forward(5)
setheading(260)
circle(-80, 70)
print(position())
penup()
goto(-74.43,-79.09)
pendown()
penup()
# 将海龟移动到指定的坐标
goto(-144,103)
pendown()
setheading(242)
circle(110, 35)
right(10)
forward(10)
setheading(250)
circle(80, 115)
print(position())
penup()
goto(-74.43,-79.09)
pendown()
setheading(10)
penup()
goto(-144, 103)
pendown()
penup()
goto(x, y)
pendown()
end_fill()
# 下巴
penup()
goto(-50, -82.09)
pendown()
pencolor("#DDA120")
fillcolor("#DDA120")
begin_fill()
setheading(-12)
circle(120, 25)
setheading(-145)
forward(30)
setheading(180)
circle(-20, 20)
setheading(143)
forward(30)
end_fill()
# penup()
# # 将海龟移动到指定的坐标
# goto(0, 0)
# pendown()
def eye():
"""画眼睛"""
# 左眼
color("black","black")
penup()
goto(-110, 27)
pendown()
begin_fill()
setheading(0)
circle(24)
end_fill()
# 左眼仁
color("white", "white")
penup()
goto(-105, 51)
pendown()
begin_fill()
setheading(0)
circle(10)
end_fill()
# 右眼
color("black", "black")
penup()
goto(25, 40)
pendown()
begin_fill()
setheading(0)
circle(24)
end_fill()
# 右眼仁
color("white", "white")
penup()
goto(17, 62)
pendown()
begin_fill()
setheading(0)
circle(10)
end_fill()
def cheek():
"""画脸颊"""
# 右边
color("#9E4406", "#FE2C21")
penup()
goto(-130, -50)
pendown()
begin_fill()
setheading(0)
circle(27)
end_fill()
# 左边
color("#9E4406", "#FE2C21")
penup()
goto(53, -20)
pendown()
begin_fill()
setheading(0)
circle(27)
end_fill()
def nose():
"""画鼻子"""
color("black", "black")
penup()
goto(-40, 38)
pendown()
begin_fill()
circle(7,steps = 3)
end_fill()
def mouth():
"""画嘴"""
color("black", "#F35590")
# 嘴唇
penup()
goto(-10, 22)
pendown()
begin_fill()
setheading(260)
forward(60)
circle(-11, 150)
forward(55)
print(position())
penup()
goto(-38.46, 21.97)
pendown()
end_fill()
# 舌头
color("#6A070D", "#6A070D")
begin_fill()
penup()
goto(-10.00, 22.00)
pendown()
penup()
goto(-14.29, -1.7)
pendown()
penup()
goto(-52, -5)
pendown()
penup()
goto(-60.40, 12.74)
pendown()
penup()
goto(-38.46, 21.97)
pendown()
penup()
goto(-10.00, 22.00)
pendown()
end_fill()
color("black","#FFD624")
penup()
goto(-78, 15)
pendown()
begin_fill()
setheading(-25)
for i in range(2):
setheading(-25)
circle(35, 70)
end_fill()
color("#AB1945", "#AB1945")
penup()
goto(-52, -5)
pendown()
begin_fill()
setheading(40)
circle(-33, 70)
goto(-16,-1.7)
penup()
goto(-18,-17)
pendown()
setheading(155)
circle(25, 70)
end_fill()
def ear():
"""画耳朵"""
# 左耳
color("black","#FFD624")
penup()
goto(-145, 93)
pendown()
begin_fill()
setheading(165)
circle(-248,50)
right(120)
circle(-248,50)
end_fill()
color("black", "black")
penup()
goto(-240, 143)
pendown()
begin_fill()
setheading(107)
circle(-170, 25)
left(80)
circle(229, 15)
left(120)
circle(300, 15)
end_fill()
# 右耳
color("black", "#FFD624")
penup()
goto(30, 136)
pendown()
begin_fill()
setheading(64)
circle(-248, 50)
right(120)
circle(-248, 50)
end_fill()
color("black", "black")
penup()
goto(160, 200)
pendown()
begin_fill()
setheading(52)
circle(170, 25)
left(116)
circle(229, 15)
left(71)
circle(-300, 15)
end_fill()
def setting():
pensize(2)
# 隐藏海龟
hideturtle()
speed(10)
def main():
setting()
face(-132,115)
eye()
cheek()
nose()
mouth()
ear()
done()
if __name__ == '__main__':
main()
-
用python画皮卡丘-用python的turtle库画皮卡丘
2020-10-28 19:56:12from turtle import *screensize(650,500,"yellow")setup(800,550)penup()goto(-185,65)pendown()pensize(5)color("black")begin_fill()circle(50,360)end_fill()penup()goto(-210,110)pendown...from turtle import *
screensize(650,500,"yellow")
setup(800,550)
penup()
goto(-185,65)
pendown()
pensize(5)
color("black")
begin_fill()
circle(50,360)
end_fill()
penup()
goto(-210,110)
pendown()
pensize(5)
color("white")
begin_fill()
circle(20,360)
end_fill()
penup()
goto(185,65)
pendown()
pensize(5)
color("black")
begin_fill()
circle(50,360)
end_fill()
penup()
goto(160,110)
pendown()
pensize(5)
color("white")
begin_fill()
circle(20,360)
end_fill()
penup()
goto(-270,-130)
pendown()
color("red")
begin_fill()
circle(75,360)
end_fill()
penup()
goto(270,-130)
pendown()
color("red")
begin_fill()
circle(75,360)
end_fill()
penup()
color("black")
begin_fill()
pensize()
goto(0,30)
seth(30)
pendown()
fd(30)
penup()
seth(120)
pendown()
circle(30,120)
penup()
seth(150)
pendown()
color("black")
fd(-30)
end_fill()
penup()
goto(0,5)
seth(190)
pensize(3)
pendown()
fd(130)
seth(150)
circle(-30,50)
penup()
goto(0,5)
seth(-10)
pensize(3)
pendown()
fd(130)
seth(30)
circle(30,50)
penup()
goto(-100,-15)
seth(290)
pendown()
fd(180)
penup()
goto(100,-15)
seth(-110)
pendown()
fd(180)
circle(-40,140)
-
用python画皮卡丘源代码-用python的turtle库画皮卡丘
2020-11-01 12:21:54from turtle import *screensize(650,500,"yellow")setup(800,550)penup()goto(-185,65)pendown()pensize(5)color("black")begin_fill()circle(50,360)end_fill()penup()goto(-210,110)pendown...from turtle import *
screensize(650,500,"yellow")
setup(800,550)
penup()
goto(-185,65)
pendown()
pensize(5)
color("black")
begin_fill()
circle(50,360)
end_fill()
penup()
goto(-210,110)
pendown()
pensize(5)
color("white")
begin_fill()
circle(20,360)
end_fill()
penup()
goto(185,65)
pendown()
pensize(5)
color("black")
begin_fill()
circle(50,360)
end_fill()
penup()
goto(160,110)
pendown()
pensize(5)
color("white")
begin_fill()
circle(20,360)
end_fill()
penup()
goto(-270,-130)
pendown()
color("red")
begin_fill()
circle(75,360)
end_fill()
penup()
goto(270,-130)
pendown()
color("red")
begin_fill()
circle(75,360)
end_fill()
penup()
color("black")
begin_fill()
pensize()
goto(0,30)
seth(30)
pendown()
fd(30)
penup()
seth(120)
pendown()
circle(30,120)
penup()
seth(150)
pendown()
color("black")
fd(-30)
end_fill()
penup()
goto(0,5)
seth(190)
pensize(3)
pendown()
fd(130)
seth(150)
circle(-30,50)
penup()
goto(0,5)
seth(-10)
pensize(3)
pendown()
fd(130)
seth(30)
circle(30,50)
penup()
goto(-100,-15)
seth(290)
pendown()
fd(180)
penup()
goto(100,-15)
seth(-110)
pendown()
fd(180)
circle(-40,140)
-
Python—— 使用turtle库画皮卡丘
2020-11-30 14:54:53Python 画皮卡丘 import turtle # 画鼻子 def drawNose(): turtle.penup() turtle.seth(90) turtle.fd(100) turtle.pendown() turtle.begin_fill() turtle.fillcolor('black') turtle.seth(45) turtle.fd...Python 画皮卡丘
import turtle # 画鼻子 def drawNose(): turtle.penup() turtle.seth(90) turtle.fd(100) turtle.pendown() turtle.begin_fill() turtle.fillcolor('black') turtle.seth(45) turtle.fd(25) turtle.seth(135) turtle.circle(25, 95) turtle.seth(315) turtle.fd(25) turtle.end_fill() # 画眼睛 def drawEyes(seth, fd, r): turtle.penup() turtle.seth(seth) turtle.fd(fd) turtle.pendown() turtle.begin_fill() turtle.fillcolor('black') turtle.circle(50) turtle.end_fill() turtle.penup() turtle.circle(50, r) turtle.pendown() turtle.begin_fill() turtle.fillcolor('white') turtle.circle(20) turtle.end_fill() # 画脸 def drawFace(seth, fd): turtle.penup() turtle.seth(seth) turtle.fd(fd) turtle.pendown() turtle.begin_fill() turtle.fillcolor('red') turtle.circle(70) turtle.end_fill() # 画嘴巴 def drawLip(): turtle.penup() turtle.seth(135) turtle.fd(250) turtle.pendown() turtle.seth(-300) turtle.circle(30, -65) turtle.begin_fill() turtle.fillcolor('Firebrick') turtle.seth(165) turtle.fd(140) turtle.seth(195) turtle.fd(140) turtle.seth(-360) turtle.circle(30, -65) turtle.penup() turtle.seth(-60) turtle.circle(30, 65) turtle.pendown() turtle.seth(-70) turtle.fd(240) turtle.circle(55, 140) turtle.seth(70) turtle.fd(240) turtle.end_fill() turtle.seth(-110) turtle.fd(80) turtle.begin_fill() turtle.fillcolor('Firebrick') turtle.seth(120) turtle.circle(120, 123) turtle.seth(-70) turtle.fd(165) turtle.circle(55, 140) turtle.seth(72) turtle.fd(165) turtle.end_fill() # 主函数 def main(): turtle.pensize(4) turtle.hideturtle() turtle.setup(1000, 600) turtle.speed(10) turtle.screensize(bg='yellow') drawNose() drawEyes(160, 250, 60) drawEyes(-9.5, 530, 230) drawFace(195, 600) drawFace(-11, 720) drawLip() turtle.done() if __name__ == '__main__': main()
下图是代码结果
-
turtle画了一个皮卡丘
2020-03-22 12:09:49from turtle import * import numpy as np reset() setup(500,500) screensize(bg='white') pensize(1.5) # 尾巴尾巴尾巴 pu() goto(0,-100) left(185) color('black','gold') begin_fill() pd() # 上尾巴 a = np... -
python 使用 turtle库 画“皮卡丘”
2020-06-15 19:15:46from turtle import * screensize(800, 600, "#fed926") setup(width=1000, height=1000, startx=50, starty=50) pensize(5) pencolor("black") speed(11) def leftEar(): # 海龟方向 setheading(30) penup() ... -
用python画皮卡丘画法-python turtle绘图库绘制【皮卡丘】源码
2020-11-01 12:42:45直接可运行,然后仔细看.../usr/bin/env python3# -*- coding: utf-8 -*-# @Author: ai8py# @Date: 2019-06-11 13:15:37# @Env: python 3.6# @Github: https://www.qi8py.comimport turtledef getPosition(x, y):tur... -
abaqus画一个球 python_Python之turtle画019--神奇宝贝球:出来吧皮卡丘
2021-01-31 19:13:59一、Python之turtle画--《神奇宝贝》中神奇宝贝球相信很多80、90后小时候都看过《神奇宝贝》,童年的记忆一下子涌上,小智的“出来吧!皮卡丘”还有“可爱又迷人的反派角色”依然历历在目,佩服漫画家天马行空的想象... -
用python画皮卡丘_用Python的turtle作画(2)——皮卡丘
2020-11-25 17:09:23from 转载于:隔壁郑同学持续更新中...... -
Python:利用turtle库绘画的眨眼睛的皮卡丘
2019-09-22 12:19:44Pikaqiu 用turtle绘画的皮卡丘 首先我们导入turtle库和time库(用来做动画使用): import turtle as t import time 由于turtle没有画曲线的函数,因此我们自定义画曲线函数,函数有4个参数,ang偏转角度,dis移动... -
python皮卡丘绘制_Python画皮卡丘
2020-12-30 12:41:22import turtle# 画鼻子def drawNose():turtle.penup()turtle.seth(90)turtle.fd(100)turtle.pendown()turtle.begin_fill()turtle.fillcolor('black')turtle.seth(45)turtle.fd(25)turtle.seth(135)turtle.circle(25,... -
教大家用python画皮卡丘的脸
2018-10-20 18:30:11仅以次程序送给我的姐姐,嘻嘻~ ...到这里,我们可爱的皮卡丘的脸就画好了,如果想送给别人,就用pyinstaller工具打包为exe,直接执行就可以了,记住一定要存为.py后缀才可以,如果将其他后缀直接改为.p... -
python代码画皮卡丘_用python画一只可爱的皮卡丘
2020-12-07 09:24:29/usr/bin/env python # -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y): """画脸""" begin_fill() penup() # 将海龟移动到指定的坐标 goto(x, y) pendown() # 设置海龟的方向 set... -
用python画皮卡丘-用python画一只可爱的皮卡丘
2020-10-28 20:10:02/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
用python画皮卡丘画法-用python画一只可爱的皮卡丘
2020-11-01 12:50:08/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
python简单代码画皮卡丘-用python画一只可爱的皮卡丘
2020-10-29 20:43:55/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
用python画皮卡丘-用python画一只可爱的皮卡丘实例
2020-10-28 21:15:36/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
用python画皮卡丘代码-用python画一只可爱的皮卡丘
2020-11-01 12:21:53/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
python简单代码画皮卡丘-用python画一只可爱的皮卡丘实例
2020-10-29 23:05:31/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
用python画皮卡丘代码-用python画一只可爱的皮卡丘实例
2020-11-01 12:42:13/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
用python画皮卡丘画法-用python画一只可爱的皮卡丘实例
2020-11-01 12:22:06/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *'''绘制皮卡丘头部'''def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到指定的坐标goto(x, y)pendown()# ... -
用python画皮卡丘的代码-用python画一只可爱的皮卡丘
2020-11-11 15:17:14/usr/bin/env python# -*- coding:utf-8 -*-from turtle import *"""绘制皮卡丘头部"""def face(x,y):"""画脸"""begin_fill()penup()# 将海龟移动到... -
简单代码画皮卡丘_编程作战丨如何利用python绘制可爱皮卡丘?
2021-01-14 13:00:06好莱坞真人电影《精灵宝可梦:大侦探皮卡丘》预告片已经发布了,正片...于是突发奇想,利用python中的turtle画了一个皮卡丘的小胖脸,哈哈哈哈哈。首先我们要好好观察皮卡丘面部的特点:1、黄色的大脸;2、一个鼻子... -
python画皮卡丘代码_编程作战丨如何利用python绘制可爱皮卡丘?
2020-12-07 10:09:03好莱坞真人电影《精灵宝可梦:大侦探皮卡丘》预告片已经发布了,正片...于是突发奇想,利用python中的turtle画了一个皮卡丘的小胖脸,哈哈哈哈哈。首先我们要好好观察皮卡丘面部的特点:1、黄色的大脸;2、一个鼻子... -
用python画皮卡丘教程-利用Python绘制萌萌哒的皮卡丘
2020-11-01 12:22:37'''Python学习交流群:960410445'''importturtle#画鼻子defdrawNose():turtle.penup()turtle.seth(90)turtle.fd(100)turtle.pendown()turtle.begin_fill()turtle.fillcolor('black')turtle.seth(45)turtle.fd(25)... -
python皮卡丘嘴怎么动_python画皮卡丘
2021-02-04 07:53:01# coding:utf-8from turtle import *import turtle as tfrom random import *def infoPrt():print('coordinate: ' + str(t.pos()))print('angle: ' + str(t.heading()))t.pensize(3)t.hideturtle()t.colormode(255)t... -
用python画皮卡丘的代码-利用Python绘制萌萌哒的皮卡丘
2020-11-11 14:51:01"""Python学习交流群:960410445"...importturtle#画鼻子defdrawNose():turtle.penup()turtle.seth(90)turtle.fd(100)turtle.pendown()turtle.begin_fill()turtle.fillcolor("black")... -
用python画皮卡丘画法-实现童年宝可梦,教你用Python画一只属于自己的皮卡丘
2020-11-01 12:55:50皮卡丘脸颊两边有着小小的...不怕,不怕,虽然现实中没有,但是我们可以画一只哟~素描什么的都弱爆了,我们来用Python画一只。经过一整天的苦战,从未接触过turtle库的文摘菌实现了从0到1,成就感满满。先看下效果...