Python代码原来还可以这样玩——画出不同人物效果图,感觉很美好

python16行代码获取原神全角色+全语音 大家早好、午好、晚好吖 ❤ ~欢迎光临本文章本来是不玩原神的,但是实在是经不住双重诱惑呀~毕竟谁能拒绝角色风景超级好看又可以爬树、炸鱼、壶里造房子、抓小动物、躲猫猫的游戏捏~今天点进官网~角色得配音让我沉陷其中,于是我决定把他们爬下来~嘿嘿嘿,下面给大家分享一下我的成果更多精彩内容、资源皆可点击文章下方名片获取此处跳转。 阅读详情

看到不少人都在用Python(大多是turtle库)绘制各种图,感觉很哇塞,就稍微整理了下觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~)

小猪佩奇
效果图:在这里插入图片描述


#!/usr/bin/env python2
# coding=utf-8
 
import turtle as t
 
t.pensize(4)
t.hideturtle()
t.colormode(255)
t.color((255,155,192),"pink")
t.setup(840,500)
t.speed(10)
 
#鼻子
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
t.begin_fill()
a=0.4
for i in range(120):
    if 0<=i<30 or 60<=i<90:
        a=a+0.08
        t.lt(3) #向左转3度
        t.fd(a) #向前走a的步长
    else:
        a=a-0.08
        t.lt(3)
        t.fd(a)
t.end_fill()
 
t.pu()
t.seth(90)
t.fd(25)
t.seth(0)
t.fd(10)
t.pd()
t.pencolor(255,155,192)
t.seth(10)
t.begin_fill()
t.circle(5)
t.color(160,82,45)
t.end_fill()
 
t.pu()
t.seth(0)
t.fd(20)
t.pd()
t.pencolor(255,155,192)
t.seth(10)
t.begin_fill()
t.circle(5)
t.color(160,82,45)
t.end_fill()
 
#头
t.color((255,155,192),"pink")
t.pu()
t.seth(90)
t.fd(41)
t.seth(0)
t.fd(0)
t.pd()
t.begin_fill()
t.seth(180)
t.circle(300,-30)
t.circle(100,-60)
t.circle(80,-100)
t.circle(150,-20)
t.circle(60,-95)
t.seth(161)
t.circle(-300,15)
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
a=0.4
for i in range(60):
    if 0<=i<30 or 60<=i<90:
        a=a+0.08
        t.lt(3) #向左转3度
        t.fd(a) #向前走a的步长
    else:
        a=a-0.08
        t.lt(3)
        t.fd(a)
t.end_fill()
 
#耳朵
t.color((255,155,192),"pink")
t.pu()
t.seth(90)
t.fd(-7)
t.seth(0)
t.fd(70)
t.pd()
t.begin_fill()
t.seth(100)
t.circle(-50,50)
t.circle(-10,120)
t.circle(-50,54)
t.end_fill()
 
t.pu()
t.seth(90)
t.fd(-12)
t.seth(0)
t.fd(30)
t.pd()
t.begin_fill()
t.seth(100)
t.circle(-50,50)
t.circle(-10,120)
t.circle(-50,56)
t.end_fill()
 
#眼睛
t.color((255,155,192),"white")
t.pu()
t.seth(90)
t.fd(-20)
t.seth(0)
t.fd(-95)
t.pd()
t.begin_fill()
t.circle(15)
t.end_fill()
 
t.color("black")
t.pu()
t.seth(90)
t.fd(12)
t.seth(0)
t.fd(-3)
t.pd()
t.begin_fill()
t.circle(3)
t.end_fill()
 
t.color((255,155,192),"white")
t.pu()
t.seth(90)
t.fd(-25)
t.seth(0)
t.fd(40)
t.pd()
t.begin_fill()
t.circle(15)
t.end_fill()
 
t.color("black")
t.pu()
t.seth(90)
t.fd(12)
t.seth(0)
t.fd(-3)
t.pd()
t.begin_fill()
t.circle(3)
t.end_fill()
 
#腮
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(-95)
t.seth(0)
t.fd(65)
t.pd()
t.begin_fill()
t.circle(30)
t.end_fill()
 
#嘴
t.color(239,69,19)
t.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(-100)
t.pd()
t.seth(-80)
t.circle(30,40)
t.circle(40,80)
 
#身体
t.color("red",(255,99,71))
t.pu()
t.seth(90)
t.fd(-20)
t.seth(0)
t.fd(-78)
t.pd()
t.begin_fill()
t.seth(-130)
t.circle(100,10)
t.circle(300,30)
t.seth(0)
t.fd(230)
t.seth(90)
t.circle(300,30)
t.circle(100,3)
t.color((255,155,192),(255,100,100))
t.seth(-135)
t.circle(-80,63)
t.circle(-150,24)
t.end_fill()
 
#手
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(-40)
t.seth(0)
t.fd(-27)
t.pd()
t.seth(-160)
t.circle(300,15)
t.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(0)
t.pd()
t.seth(-10)
t.circle(-20,90)
 
t.pu()
t.seth(90)
t.fd(30)
t.seth(0)
t.fd(237)
t.pd()
t.seth(-20)
t.circle(-300,15)
t.pu()
t.seth(90)
t.fd(20)
t.seth(0)
t.fd(0)
t.pd()
t.seth(-170)
t.circle(20,90)
 
#脚
t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(-75)
t.seth(0)
t.fd(-180)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
t.pensize(15)
t.fd(20)
 
t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(40)
t.seth(0)
t.fd(90)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
t.pensize(15)
t.fd(20)

'更多python代码和学习资料看主页'
 
#尾巴
t.pensize(4)
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(70)
t.seth(0)
t.fd(95)
t.pd()
t.seth(0)
t.circle(70,20)
t.circle(10,330)
t.circle(70,30)

皮卡丘
效果图:在这里插入图片描述

实现代码:

import turtle as t

def infoPrt():
    print('coordinate: ' + str(t.pos()))
    print('angle: ' + str(t.heading()))

t.pensize(3)
t.hideturtle()
t.colormode(255)
t.color("black")
t.setup(700, 650)
t.speed(10)
t.st()
#t.dot()
t.pu()
#t.goto(-150,100)
t.goto(-210,86)
t.pd()
infoPrt()

# 头
print('头')
t.seth(85)
t.circle(-100,50)
#t.seth(78)
#t.circle(-100,25)

infoPrt()

t.seth(25)
t.circle(-170,50)
infoPrt()

# 右耳
print('右耳')
t.seth(40)
#t.circle(-250,52)
t.circle(-250,30)
infoPrt()


# 右耳尖
t.begin_fill()
# 左
t.circle(-250,22)
#t.fillcolor("pink")
# 右
t.seth(227)
t.circle(-270, 15)

prePos = t.pos()
infoPrt()
# 下
t.seth(105)
t.circle(100, 32)
t.end_fill()

t.pu()
t.setpos(prePos)
t.pd()
t.seth(212)
t.circle(-270, 28)

prePos = t.pos()
t.pu()
t.goto(t.xcor()+5,t.ycor()-2)
t.pd()

# 躯干
print('躯干')
t.seth(280)
t.circle(500, 30)
infoPrt()

# 臀部
print('臀部')
t.seth(120)
#t.circle(150, -55)
t.circle(150, -11)
p_tail=t.pos()
t.circle(150, -44)
p_butt=t.pos()
infoPrt()

# 尾巴
t.pu()
t.setpos(p_tail)
t.pd()

t.begin_fill()
t.seth(50)
t.fd(25)
t.seth(-50)
t.fd(30)
p_tail1=t.pos
t.seth(-140)
t.fd(36)
t.end_fill()
t.seth(39)
# 右尾和h1
t.fd(72)
# 右尾和v1
t.seth(125)
t.fd(48)
# 右尾和h2
t.seth(40)
t.fd(53)
# 右尾和v2
t.seth(88)
t.fd(45)
# 右尾和h3
t.seth(35)
t.fd(105)
# 右尾和v3
t.seth(105)
t.circle(850, 8)
#t.fd(105)
t.seth(215)
#t.fd(125)
t.circle(850, 11)
t.seth(280)
t.fd(110)
t.seth(220)
t.fd(50)
t.seth(309)
t.fd(56)

# 底盘
print('底盘')
t.pu()
t.setpos(p_butt)
t.pd()
t.seth(20)
t.circle(120, -45)
infoPrt()

t.seth(330)
t.circle(-150, -30)
infoPrt()

prePos = t.pos()
t.pu()
t.goto(t.xcor()+20,t.ycor())
t.pd()

t.seth(230)
t.circle(-70, 120)
p_bot=t.pos()

# 两脚-right
t.pu()
t.setpos(p_butt)
t.setpos(t.xcor()+5,t.ycor()+5)
t.pd()
t.seth(-86)
t.fd(30)
t.seth(-93)
t.fd(33)
t.seth(-225)
t.circle(-150, 22)
# 两脚-left
t.pu()
t.setpos(p_bot)
t.setpos(t.xcor()+85,t.ycor()-43)
t.pd()
t.seth(-105)
t.fd(50)
t.seth(-225)
t.circle(-150, 22)

# 左躯干
print('躯干')
t.pu()
t.setpos(p_bot)
t.pd()
t.seth(90)
t.circle(450, 13)
p_lfhd = t.pos()
t.circle(450, 5)
t.pu()
t.circle(450, 5)
t.pd()
t.circle(450, 6)
infoPrt()

# 左脸
print('左脸')
t.seth(330)
t.circle(50, -90)
infoPrt()

# 左酒窝
t.seth(30)
t.circle(-15, 120)
t.seth(-70)
t.circle(-30, 90)

# 左手
t.pu()
t.setpos(p_lfhd)
t.pd()
t.seth(160)
t.circle(150, 30)
infoPrt()

t.seth(180)
t.circle(-30, 150)
t.fd(67)

t.pu()
t.setpos(t.xcor()-40,t.ycor()-60)
t.pd()
t.seth(200)
t.circle(-5, 180)

# 右手
t.pu()
t.setpos(p_lfhd)
t.setpos(t.xcor()+180,t.ycor()+5)
t.pd()
t.seth(200)
t.circle(-50, 100)
t.pu()
t.circle(-50, 15)
t.pd()
t.circle(-50, 65)
t.pu()
t.setpos(t.xcor()+10,t.ycor()-45)
t.pd()
#t.seth(270)
#t.circle(-30, -180)
t.seth(80)
t.fd(10)
t.seth(165)
t.circle(10, 60)
t.seth(90)
t.fd(5)
t.seth(165)
t.circle(10, 60)
t.seth(95)
t.fd(5)
t.seth(185)
t.circle(10, 60)
t.seth(105)
t.fd(10)
t.seth(230)
t.fd(20)
t.seth(145)
t.fd(10)
t.seth(285)
t.fd(20)

# 右酒窝
t.pu()
t.setpos(t.xcor()-40,t.ycor()+110)
t.pd()
t.circle(27, 360)

# 嘴
t.pu()
t.setpos(t.xcor()-30,t.ycor()+28)
t.pd()
t.seth(280)
t.circle(-130, 30)
t.seth(270)
t.circle(-6, 160)
t.seth(130)
t.circle(-130, 30)
t.pu()
t.setpos(t.xcor()-5,t.ycor()+5)
t.pd()
t.seth(160)
t.circle(-20, -70)
t.seth(160)
t.circle(-30, -60)
t.pu()
t.setpos(t.xcor(),t.ycor()-28)
t.pd()
t.seth(200)
t.circle(50, 58)

# 左眼
t.pu()
t.setpos(t.xcor()-40,t.ycor()+90)
t.pd()
t.circle(5)
t.pu()
t.setpos(t.xcor()+5,t.ycor()+10)
t.pd()
t.begin_fill()
t.seth(190)
t.circle(15, 130)
t.seth(310)
t.circle(10, 15)
t.seth(0)
t.circle(17, 133)
t.seth(90)
t.circle(10, 15)
t.end_fill()
t.pu()
t.setpos(t.xcor()+2,t.ycor()-15)
t.pd()
t.color("white")
t.begin_fill()
t.circle(5)
t.end_fill()

# 右眼
t.pu()
t.setpos(t.xcor()+85,t.ycor()+15)
t.pd()
t.color("black")
t.circle(5)
t.pu()
t.setpos(t.xcor()+5,t.ycor()+10)
t.pd()
t.begin_fill()
t.seth(190)
t.circle(20, 130)
t.seth(310)
t.circle(10, 15)
t.seth(0)
t.circle(22, 133)
t.seth(90)
t.circle(13, 15)
t.end_fill()
t.pu()
t.setpos(t.xcor()-7,t.ycor()-15)
t.pd()
t.color("white")
t.begin_fill()
t.circle(7)
t.end_fill()

# 左耳
t.color("black")
t.pu()
t.goto(-210,86)
t.setpos(t.xcor()+15,t.ycor()+38)
t.pd()
t.seth(90)
t.circle(-250,30)

t.begin_fill()
# 左
t.circle(-250,18)

# 右
t.seth(270)
t.circle(-270, 12)

prePos = t.pos()
# 下
t.seth(180)
t.circle(100, 30)
t.end_fill()

t.pu()
t.setpos(prePos)
t.pd()
t.seth(270)
t.circle(-270, 18)


t.done()

叮当猫
效果图:
在这里插入图片描述

实现代码:

import turtle

turtle.speed(5)
turtle.circle(50)
turtle.begin_fill()           #画头
turtle.circle(85)
turtle.fillcolor("blue")
turtle.end_fill()

# turtle.penup()
# turtle.goto(0,20)
# turtle.pendown()

# turtle.begin_fill()
# turtle.circle(35)
# turtle.fillcolor("white")
# turtle.end_fill()

turtle.begin_fill()                #画脸
turtle.circle(60)
turtle.fillcolor("white")
turtle.end_fill()



turtle.penup()
turtle.goto(-20,95)             #化左眼眶
turtle.pendown()
turtle.begin_fill()
turtle.circle(19)
turtle.fillcolor("white")
turtle.end_fill()



turtle.penup()                  #画右眼眶
turtle.goto(20,95)
turtle.pendown()
turtle.begin_fill()
turtle.circle(19)
turtle.fillcolor("white")
turtle.end_fill()

turtle.penup()                 #化左眼珠
turtle.goto(-8,111)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("black")
turtle.circle(3)
turtle.end_fill()


turtle.penup()              #画右眼珠
turtle.goto(8,111)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("black")
turtle.circle(3)
turtle.end_fill()

turtle.penup()              #画鼻子
turtle.goto(0,85)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("red")
turtle.end_fill()


turtle.goto(0,30)               #画竖线

turtle.penup()            #左边第一根胡子
turtle.goto(-20,70)
turtle.pendown()
turtle.goto(-45,80)

turtle.penup()                  #左边第二根胡子
turtle.goto(-20,60)
turtle.pendown()
turtle.goto(-47,60)

turtle.penup()                  #左边第三根胡子
turtle.goto(-20,50)
turtle.pendown()
turtle.goto(-47,40)

turtle.penup()                  #右边第三根胡子
turtle.goto(20,50)
turtle.pendown()
turtle.goto(47,40)


turtle.penup()                  #右边第二根胡子
turtle.goto(20,60)
turtle.pendown()
turtle.goto(47,60)


turtle.penup()                  #左边第一根胡子
turtle.goto(20,70)
turtle.pendown()
turtle.goto(45,80)

turtle.penup()                  #右边胳膊1
turtle.goto(50,20)
turtle.pendown()
turtle.goto(100,-10)


turtle.penup()                  #右边胳膊2
turtle.goto(50,-20)
turtle.pendown()
turtle.goto(80,-40)

turtle.begin_fill()
turtle.goto(100,-10)
turtle.goto(50,20)
turtle.goto(50,-20)
turtle.goto(80,-40)
turtle.fillcolor("yellow")
turtle.end_fill()



turtle.penup()                  #右手
turtle.goto(100,-50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(20)
turtle.fillcolor("blue")
turtle.end_fill()



turtle.penup()                  #左边胳膊1
turtle.goto(-50,20)
turtle.pendown()
turtle.goto(-100,-10)


turtle.penup()                  #左边胳膊2
turtle.goto(-50,-20)
turtle.pendown()
turtle.goto(-80,-40)

turtle.begin_fill()
turtle.goto(-100,-10)
turtle.goto(-50,20)
turtle.goto(-50,-20)
turtle.goto(-80,-40)
turtle.fillcolor("yellow")
turtle.end_fill()

turtle.penup()                  #左手
turtle.goto(-100,-53)
turtle.pendown()
turtle.begin_fill()
turtle.circle(20)
turtle.fillcolor("blue")
turtle.end_fill()


turtle.penup()                  #左手
turtle.goto(-50,-20)
turtle.pendown()
turtle.goto(-50,-100)

turtle.penup()                  #左手
turtle.goto(50,-20)
turtle.pendown()
turtle.goto(50,-100)


turtle.begin_fill()
turtle.penup()
turtle.goto(50,-120)
turtle.pendown()
turtle.circle(10)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.begin_fill()
turtle.goto(20,-120)
turtle.circle(10)
turtle.fillcolor("blue")
turtle.end_fill()


turtle.penup()
turtle.goto(50,-100)
turtle.pendown()
turtle.goto(20,-100)



turtle.penup()
turtle.goto(-50,-120)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.goto(-20,-120)
turtle.circle(10)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup()
turtle.goto(-20,-100)
turtle.pendown()
turtle.goto(-50,-100)


turtle.penup()
turtle.goto(-20,-100)
turtle.pendown()
turtle.goto(-20,-85)

turtle.goto(20,-85)
turtle.goto(20,-100)

turtle.penup()
turtle.goto(-50,-20)
turtle.pendown()

turtle.begin_fill()
turtle.goto(50,-20)
turtle.goto(50,-85)
turtle.goto(-50,-85)
turtle.goto(-50,-20)
turtle.fillcolor("blue")
turtle.end_fill()


turtle.penup()
turtle.goto(0,-20)    #铃铛
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("yellow")
turtle.end_fill()



turtle.penup()
turtle.goto(-10,-10)
turtle.pendown()
turtle.goto(10,-10)


turtle.penup()
turtle.goto(-50,20)
turtle.pendown()
turtle.begin_fill()
turtle.goto(50,20)
turtle.goto(50,0)
turtle.goto(-50,0)
turtle.goto(-50,20)
turtle.fillcolor("red")
turtle.end_fill()


turtle.penup()
turtle.goto(50,0)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("red")
turtle.end_fill()


turtle.penup()
turtle.goto(-50,0)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("red")
turtle.end_fill()


turtle.penup()                  #内裤
turtle.goto(-50,-70)
turtle.pendown()
turtle.begin_fill()
turtle.goto(50,-70)
turtle.goto(50,-50)
turtle.goto(-50,-50)
turtle.goto(-50,-70)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup()
turtle.goto(-10,-70)
turtle.pendown()
turtle.begin_fill()
turtle.goto(-10,-85)
turtle.goto(10,-85)
turtle.goto(10,-70)
turtle.goto(-10,-70)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup()
turtle.goto(-100,200)
turtle.pendown()
s = "机器猫中的战斗猫"
turtle.write(s,font = ("Arial",20,
                       "normal"))


turtle.done()

路飞骷颅头
效果图:
在这里插入图片描述

#路飞骷髅
import turtle as t
#黄底帽子
t.pu()
t.goto(0,200)
t.circle(-130,-80)
t.pd()
t.colormode(255)
t.pensize(5)
t.color(242,232,184) #帽子黄底RGB
t.begin_fill()
t.pencolor(0,0,0)
t.circle(-130,160)
t.seth(180)
t.fd(255)
t.end_fill()
 
#红色线条
t.begin_fill()
t.color(221,65,43) #帽子红色带
t.pencolor(0,0,0)
t.seth(80)
t.circle(-130,19)
t.seth(0)
t.fd(225)
t.seth(-59)
t.circle(-130,19)
t.seth(180)
t.fd(255)
t.end_fill()
 
#帽檐
t.begin_fill()
t.color(242,232,184)
t.pencolor(0,0,0)
t.fd(60)
t.circle(12,180)
t.fd(375)
t.circle(12,180)
t.fd(255 + 60)
t.end_fill()
 
#脸部下半轮廓
t.pu()
t.setpos(0,-30)
t.seth(-180)
t.circle(-130,-75)
t.pd()
t.circle(-130,150)
 
#眼睛鼻子
t.pu()
t.color(33,24,24) #眼睛、鼻子RGB
t.setpos(-45,64)
t.seth(-180)
t.pd()
t.begin_fill()
t.circle(33)
t.pu()
t.setpos(45,64)
t.pd()
t.circle(33)
t.end_fill()
 
t.pu()
t.setpos(0,5)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
 
#下巴
t.pencolor(0,0,0)
t.pu()
t.setpos(0,0)
t.seth(0)
t.circle(-75,45)
t.pd()
t.circle(-75,270)
 
#牙齿
t.pu()
t.setpos(0,120)
t.seth(0)
t.circle(-105,136)
t.pd()
t.circle(-105,86)
 
t.pu()
t.seth(0)
t.goto(0,200)
t.circle(-130,150)
t.pd()
t.circle(-130,60)
 
t.pu() #牙齿三根竖线
t.setpos(-30,-27)
t.seth(260)
t.pd()
t.fd(52)
t.pu()
t.setpos(30,-27)
t.pd()
t.seth(-260)
t.fd(-52)
t.pu()
t.setpos(0,-30)
t.seth(-90)
t.pd()
t.fd(56)
 
#上排右侧小爪爪
#释放注释为:上排右侧小爪爪实心金方案
t.pu()
#t.color(255,215,0) #金色的RGB
t.pencolor(0,0,0)
t.setpos(110,145)
t.seth(45)
t.pd()
#t.begin_fill()
t.fd(40)
t.seth(135)
t.circle(-30,235)
t.seth(-20)
t.circle(-30,220)
t.seth(-135)
t.fd(40)
#t.end_fill()
 
#上排左侧小爪爪
t.pu()
t.pencolor(0,0,0)
t.setpos(-110,145)
t.seth(135)
t.pd()
t.fd(40)
t.seth(45)
t.circle(30,235)
t.seth(-160)
t.circle(30,220)
t.seth(-45)
t.fd(40)
 
#下排右侧小爪爪
t.pu()
t.setpos(70,-10)
t.seth(-45)
t.pd()
t.fd(70)
t.seth(45)
t.circle(-30,235)
t.seth(-70)
t.circle(-30,255)
t.seth(135)
t.fd(22)
 
#下排左侧小爪爪
t.pu()
t.setpos(-70,-10)
t.seth(-135)
t.pd()
t.fd(70)
t.seth(135)
t.circle(30,235)
t.seth(-110)
t.circle(30,255)
t.seth(45)
t.fd(22)

是不是感觉很不错呀!

【Python爬虫案例教学】超简洁代码采集原神所有角色信息 (。・∀・)ノ゙嗨 大家好,这里是池鱼 阅读详情

相关推荐

python画元神英雄(琴)

【代码】python画元神英雄(琴)

xm-love-mq的博客 3155

生成原神中的胡桃的头像python绘画代码

很抱歉,由于我是一个训练有素的语言模型,不能生成代码。但是我可以提供一些指导,帮助你自己编写代码。 首先,你可以使用 Python 图像处理库,如 Pillow、OpenCV 或 Matplotlib 等。这些库都有许多可以用来创建图像的函数和方法。 其次,你可以通过查找已有的头像图像,并使用这些库的功能在图像上绘制胡桃的头像。 最后,请确保你的代码符合相关法律法规和许可协议,以避免侵犯版权等问题...

weixin_42610671的博客 2960

用Python写一个天天酷跑

感觉上次写的植物大战僵尸与俄罗斯方块的反应还不错,这次这个文章就更有动力了 这次就写一个天天酷跑吧 写出来的效果图就是这样了 下面就更新一下全部的代码吧 还是老样子先定义 import pygame,sys import random 写一下游戏配置 width = 1200 #窗口宽度 height = 508 #窗口高度 size = width, height score=None #分数 myFont=myFont1=N

Gtieguo的博客 2万+

盘点你小时候玩过的游戏,有都玩过的吗?用Python实现马里奥来恋旧

python制作超级玛丽游戏,供大家参考,具体内容如下 这篇文章,我们优先介绍超级玛丽游戏中的多状态跳跃,和行走地图拖动的原理,然后实现。并实现倒计时和金币动态效果 接下来用下面这四张图,就可以完全懂得游戏中背景是怎么会移动的。 图1 图2 图3 图4 由于代码是我前几年学习python的时候做的,代码写的很挤都整到一个源文件中,大家看的时候仔细。 然后上源代码: #!/usr/bin/env python # -*- coding:utf-8 -*- import pygame,os,w

yunyun云芸 377

python实现人像动漫化的示例代码

利用百度api实现人像动漫化 百度API地址:https://ai.baidu.com/tech/imageprocess/selfie_anime 技术文档:https://ai.baidu.com/ai-doc/IMAGEPROCESS/Mk4i6olx5 注册百度账号,开通实现人像动漫化,创建应用。 # encoding:utf-8 import requests import base64 # client_id 为官网获取的AK, client_secret 为官网获取的SK host = 'https://aip.baidubce.com/oauth/2.0/token?gr

NXP MCU CAN波特率(位时间)配置详解

1. 概述 本文将会详细讲解如何设置NXP MCU的CAN波特率、位时间、采样点等属性。 波特率即CAN总线传输频率,位时间是波特率的倒数,例如波特率是500K,那么位时间 = 1 / 500000 = 0.000002s = 2000ns。 我们先来看一下S32K144单片机的EB中与CAN总线波特率相关的可配置参数有哪些: ...

weixin_42967006的博客 9692

别再自己抠图了,Python用5行代码实现批量抠图

前言 对于会PhotoShop的人来说,弄一张证件照还是非常简单的,但是还是有许多人不会PhotoShop的。今天就给你们带来一个非常简单的方法,用Python快速生成一个证件照,照片的底色随你选。 实现原理 生成证件照的原理非常简单,两步就可以完成。首先我们需要抠图,然后将透明的地方填相应的颜色,按照需求填相应的颜色。 要是之前我对抠图是束手无策的,但是前几天发现了深度学习开发工具PaddleH...

ZackSock的博客 9万+

VMvare 桥接模式无法联网、没有未桥接的主机网络适配器,无法将网络更改为桥接状态。

很多程序员,整天沉浸在业务代码的 CRUD 中,业务中没有大量数据做并发,缺少实战经验,对并发仅仅停留在了解,做不到精通,所以总是与大厂擦肩而过。我把私藏的这套并发体系的笔记和思维脑图分享出来,理论知识与项目实战的结合,我觉得只要你肯花时间用心学完这些,一定可以快速掌握并发编程。《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!战项目源码讲义》点击传送门即可获取!**

q16974058的博客 4332

别再自己抠图了,Python教你一招弄完_python 实现 photoshop 的魔术棒算法

对于抠图来说,专业人用来实现,但是小编觉得他们处理能力有限,一次只能处理一张图片,对于一些比较复杂的图,有时候还是需要花点时间的,今天就给大家带了一个非常快速简单的办法,刚开始,我也不看好python自动抠图,总觉得不够精确,抠不出满意的图。但是后面发现真香!下面我就直接展示一下效果图吧。我们先看看原图 :这张图片背景是纯色,我们平时用PhotoShop抠起来也比较简单,对我们计算机来说也不是什么难题,下面是因为本身是PNG图片,而且原图是白色背景,所以看不出什么区别。

m0_60607971的博客 1499

cesium 深度图(获取区域最高最低点位)

文章摘要: Cesium深度图技术可用于获取区域地形高程数据,核心实现步骤包括:1)通过离屏相机构建独立渲染环境,使用正交投影确保采样精度;2)采用离屏渲染技术获取均匀分布的地形点数据。关键技术点包含多边形外包矩形计算、后台相机配置(5km高度正交投影)、1024×1024像素离屏视图设置,以及深度数据解析(RGBA格式转换和三维坐标还原)。该方法避免了主视图干扰,可精准获取区域内地形高程信息,为填挖方分析等应用提供基础数据支持。

God's asylum的博客 283

一种独特机理驱动的化学反应分类器详解

代码位置第 47-300+ 行// atom_494: 硫原子,度数=2,化合价=2,无H,无电荷!// atom_35: 氧原子,度数=1,1个H,无电荷// atom_347: 氧原子,度数=2,无H,无电荷!→atom_494()[OD1h1+0]→atom_35()→atom_347()特性传统方法(MCS)NameRXN(机理驱动)匹配策略最大公共子结构原子类型模式 + 操作码时间复杂度O(n) - 线性扫描机理理解无内置化学机理原子映射需额外计算自动推导准确性结构相似。

ASKCOS博客 159

python 是否可以一键修图_Python用5行代码实现批量抠图的示例代码

前言对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过一些比较复杂的图,有时候还是要画点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示开始吧,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图这张图片背景未纯色,我们平时用PhotoShop抠起来也比较简单,对我们计算机...

weixin_39632891的博客 294

抖音 X-Gorgon 加密算法逆向与 Python 爬虫实战(2026 最新版)

抖音(TikTok 国内版)作为日活超 8 亿的超级 App,其反爬体系在国内互联网中属于顶级难度。核心签名参数X-Gorgon和X-Khronos是几乎所有业务接口(视频详情、评论、搜索、用户主页)的“通行证”。没有正确的 Gorgon 签名,服务器直接返回403或。市面上的教程大多停留在2023 年之前的 V4 版本,而抖音在 2025 年底全面升级到了V6 协议,算法结构、加密常数、混淆方式全部重构。

2201_76125261的博客 357

python 抠图源码_别再自己抠图了,Python用5行代码实现批量抠图

前言对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过一些比较复杂的图,有时候还是要画点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示开始吧,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图这张图片背景未纯色,我们平时用PhotoShop抠起来也比较简单,对我们计算机...

weixin_39954682的博客 2535

OpenClaw 运行时错误文档:Embedded Run Agent End with Stream Error(嵌入式运行代理结束流式错误)

OpenClaw运行时错误文档:EmbeddedRunAgentEndwithStreamError(OC-ERR-009) 该错误表示LLM提供商在流式传输过程中发生服务器端异常(HTTP 500),属于可恢复的中等严重性错误。典型表现为日志中出现包含"stream_error"和500状态码的错误信息。系统会自动进行错误分类(50%为服务过载,25%网络问题等),并通过内置机制尝试解决:包括模型切换、API密钥轮换和自动重试策略。用户可采取重试请求、切换模型或简化请求内容等操作,管理

多媒体编程、网络编程、系统编程、网络安全编程、驱动编程 554

eDP V1.4协议介绍

eDP的全称是Embedded DisplayPort嵌入式显示端口,主要应用与短距离系统内应用,例如手机、一体式台式机等。eDP V1.4b是基于DP V1.3标准制作完成,但因应用场景的不同,还是有很多区别。电压摆幅不同,eDP相对较低;eDP功耗相对较低;DP有线材和连接器的要求,eDP没有明确要求;AUX通道电路设计不同(相对DP取消了AC耦合电容和100KΩ/1MΩ的上下拉电阻):典型应用场景;

qflook的博客 4304

代码 抠图_别再用PS了,我用五行Python代码就实现了批量抠图

对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过对于一些比较复杂的图,有时候还是需要花点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示刚开始,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图 :​这张图片背景是纯色,我们平时用PhotoShop抠起来也比较简单,对我...

weixin_39661405的博客 130

Central Finance 全景解析:用 SAP S/4HANA 构建跨系统的财务中台与渐进式转型路径

Central Finance 是基于 SAP S/4HANA 的一种部署与应用场景:在不打断现有异构源系统运营的前提下,把多套 SAP 与非 SAP 系统中的财务与管理会计数据实时/准实时复制到一套中心化的 SAP S/4HANA 中,作为统一的记账与分析底座,逐步把选定的财务流程(如预算控制、付款、固定资产结账等)迁入中心系统。这让企业既能快速获得统一报表与统一核算结构,又为未来的整体迁移留出了弹性路径。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 393

python抠图_别再用PS了,我用五行Python代码就实现了批量抠图

对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过对于一些比较复杂的图,有时候还是需要花点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示刚开始,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图 :这张图片背景是纯色,我们平时用PhotoShop抠起来也比较简单,对我们...

weixin_39686192的博客 422

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

python抠图精确到发丝_别再用PS了,我用五行Python代码就实现了批量抠图

对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过对于一些比较复杂的图,有时候还是需要花点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示刚开始,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图 :这张图片背景是纯色,我们平时用PhotoShop抠起来也比较简单,对我们...

weixin_39734458的博客 584

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

python复杂背景抠图_别再自己抠图了,Python用5行代码实现批量抠图

前言对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过一些比较复杂的图,有时候还是要画点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示开始吧,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图这张图片背景为纯色,我们平时用PhotoShop抠起来也比较简单,对我们计算机...

weixin_39605835的博客 370

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

pip install自己的代码_别再用PS了,我用五行Python代码就实现了批量抠图

对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过对于一些比较复杂的图,有时候还是需要花点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示刚开始,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图 :​这张图片背景是纯色,我们平时用PhotoShop抠起来也比较简单,对我...

weixin_39611382的博客 265

怎么批量抠复杂的图_别再自己抠图了,Python用5行代码实现批量抠图

前言对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过一些比较复杂的图,有时候还是要画点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示开始吧,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图这张图片背景未纯色,我们平时用PhotoShop抠起来也比较简单,对...

weixin_39661353的博客 238

python100内的所有素数以五行每行的形式_别再用PS了,我用五行Python代码就实现了批量抠图...

对于会PhotoShop的人来说,抠图是非常简单的操作了,有时候几秒钟就能扣好一张图。不过对于一些比较复杂的图,有时候还是需要花点时间的,今天就给大家带了一个非常快速简单的办法,用Python来批量抠取人像。效果展示刚开始,我也不看好什么自动抠图,总觉得不够精确,抠不出满意的图。下面我就直接展示一下效果图吧。我们先看看原图 :这张图片背景是纯色,我们平时用PhotoShop抠起来也比较简单,对我们...

weixin_39758953的博客 474
上一篇: Python基础语法整理
下一篇: 就这??利用爬虫技术可以做到这样有趣
克金森沐沐
博客等级 码龄6年 694粉丝 64原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值