苹果手机运行python_python画iPhone手机,这种操作有几个人见过?

虽然我用不起苹果手机,但我可以用python画出来!

环境准备

运行平台: Windows

Python版本: Python 3.6.4

IDE: Pycharm或自带的IDLE

绘制代码

如果你感觉学不会?莫慌,小编推荐大家加入群,

前面548中间377后面875,群里有志同道合的小伙伴,

互帮互助,还可以拿到许多视频教程!

import turtle

def round_rectangle(length,high,cor_angle,cor_rad):

for i in range(2):

turtle.fd(high)

turtle.circle(cor_rad,cor_angle)

turtle.fd(length)

turtle.circle(cor_rad,cor_angle)

def main():

turtle.setup(1300,800,0,0)#启动窗口的大小,左上角右上角坐标

pythonsize=2

turtle.pensize(pythonsize)#运行宽度

turtle.speed(10)

turtle.seth(90)#启动时运行的方向(角度)

#最外边框

turtle.pencolor("#8E8e8e")

turtle.penup()

turtle.goto(202,-202)

turtle.pendown()

round_rectangle(244,484,90,30)

#填充

turtle.penup()

turtle.goto(200,-200)

turtle.pendown()

turtle.begin_fill()

turtle.color("#F0F0F0")

round_rectangle(240,480,90,30)

turtle.end_fill()

#手机屏

turtle.pencolor("black")#(#3000440)

turtle.penup()

turtle.goto(185,-150)

turtle.pendown()

turtle.begin_fill()

turtle.color("black")

round_rectangle(270,380,90,0)

turtle.end_fill()

#听筒

turtle.penup()

turtle.goto(80,265)

turtle.pendown()

turtle.begin_fill()

turtle.color("#9d9d9d")

round_rectangle(60,4,90,1)

turtle.end_fill()

#听筒上面的小黑

turtle.penup()

turtle.goto(55,290)

turtle.pendown()

turtle.begin_fill()

turtle.color("#3c3c3c")

turtle.circle(4,360)

turtle.end_fill()

#摄像头

turtle.penup()

turtle.goto(0,265)

turtle.pendown()

turtle.begin_fill()

turtle.color("#3c3c3c")

turtle.circle(6,360)

turtle.end_fill()

#home健

turtle.pencolor("#9d9d9d")#(#3000440)

turtle.penup()

turtle.goto(75,-185)

turtle.pendown()

turtle.circle(25,360)

#home健图案

turtle.pencolor("#9d9d9d")#(#3000440)

turtle.penup()

turtle.goto(60,-190)

turtle.pendown()

turtle.hideturtle()

main()

运行结果:

缩略图:

大声告诉我,这种教程你以前见过吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值