校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > 如何用Python畫一些簡單形狀你知道嗎

如何用Python畫一些簡單形狀你知道嗎

熱門標簽:地圖標注與注銷 宿州電話機器人哪家好 百應電話機器人總部 無錫智能外呼系統好用嗎 西青語音電銷機器人哪家好 南昌地圖標注 成都呼叫中心外呼系統哪家強 旅游廁所地圖標注怎么弄 電梯新時達系統外呼顯示e

進入主題

1.

import turtle as t
import math
t.pensize(3)
t.tracer(10)
t.hideturtle()
start_x = -200
for y in range(-150,150,5):
    t.penup()
    t.goto(start_x,y)
    t.pendown()
    for x in range(-200,200,1):
        if ((y-50*(math.cos(0.05*x)) = 80) and
            (y-50*(math.cos(0.05*x)) >= 60)):
            t.pencolor('yellow')
        elif ((y-50*(math.cos(0.05*x)) = 40) and
            (y-50*(math.cos(0.05*x)) >= -20)):
            t.pencolor('blue')
        elif ((y-50*(math.cos(0.05*x)) = -20) and
            (y-50*(math.cos(0.05*x)) >= -80)):
            t.pencolor('red')
        elif ((y-50*(math.cos(0.05*x)) = -60) and
            (y-50*(math.cos(0.05)) = -80)):
            t.pencolor('green')
        else:
            t.pencolor('black')
        t.setx(x)
t.update()
t.done()

import turtle as t
t.speed(0)
t.tracer(20)
t.hideturtle()
t.colormode(255)
angle = 90
for x in range(255,0,-5):
    for n in range(360//angle):
        t.pencolor((x,255,255))
        t.fillcolor((25,x,255))
        t.begin_fill()
        for i in range(2):
            t.forward(x)
            t.right(angle)
            t.forward(x)
            t.right(180-angle)
        t.end_fill()
        t.right(angle)
t.update()
t.done()

import turtle as t
t.speed(0)
t.tracer(20)
t.colormode(255)
angle = 60
angle2 = 3
for x in range(255,0,-5):
    for n in range(360//angle):
        t.pencolor((x,255,255))
        t.fillcolor((255,x,255))
        t.begin_fill()
        for i in range(2):
            t.forward(x)
            t.right(angle)
            t.forward(x)
            t.right(180-angle)
        t.end_fill()
        t.right(angle)
    t.right(angle2)
t.update()
t.done()

from turtle import *       
colormode(255)
tracer(5)
a1=39
a2=1
for x in range(255,0,-5):
    pencolor(x,255,255)
    fillcolor(255,x,255)
    for y in range(360//a1):
        begin_fill()
        for z in range(2):
            fd(x)
            rt(a1)
            fd(x)
            rt(180-a1)
        end_fill()
        rt(a1)
    rt(a2)
update()
ht()
done()

import turtle as t
t.speed(0)
t.hideturtle()
t.penup()
t.setx(-200)
t.pendown()
r = 20
i = 6
for x in range(10):
    if x % 2 == 0:
        t.fillcolor("skyblue")
        t.begin_fill()
        t.circle(r)
        t.end_fill()
        add = 0
    else:
        t.fillcolor("green")
        t.begin_fill()
        for n in range(4):
            t.forward(r*2)
            t.left(90)
        t.end_fill()
        add = r*2
    t.penup()
    t.forward(r+i+add)
    t.pendown()
t.done()

import turtle as t
t.pensize(5)
t.tracer(10)
t.hideturtle()
start_x = -200
for y in range(-150,150,20):
    t.penup()
    t.goto(start_x,y)
    t.pendown()
    for x in range(-200,200,1):
        if ((x  100 and x > 0) and 
            (y  80 and y > 0)):
            t.pencolor('yellow')
        elif ((x  100 and x > 0) and
            (y  0 and y > -80)):
            t.pencolor('blue')
        elif ((x  0 and x > -100) and
            (y  80 and y > 0)):
            t.pencolor('red')
        elif ((x  0 and x > -100) and
            (y  0 and y > -80)):
            t.pencolor('orange')
        else:
            t.pencolor('green')
        t.setx(x)
t.update()
t.done()

import turtle as t
t.pensize(5)
t.tracer(10)
t.hideturtle()
start_x = -200
for y in range(-150,150,20):
    t.penup()
    t.goto(start_x,y)
    t.pendown()
    for x in range(-200,200,1):
        if ((y-x = 40) and
            (y-x >= -40)):
            t.pencolor('yellow')
        elif ((y+x = 40) and
            (y+x >= -40)):
            t.pencolor('blue')
        else:
            t.pencolor('green')
        t.setx(x)
t.update()
t.done()

import turtle as t
t.speed(0)
t.tracer(20)
t.hideturtle()
t.colormode(255)
angle = 60
for x in range(255,0,-5):
    for n in range(360//angle):
        t.pencolor((x,255,255))
        t.fillcolor((255,x,255))
        t.begin_fill()
        for i in range(2):
            t.forward(x)
            t.right(angle)
            t.forward(x)
            t.right(180-angle)
        t.end_fill()
        t.right(angle)
t.update()
t.done()

總結

本篇文章就到這里了,希望能給你帶來幫助,也希望您能夠多多關注腳本之家的更多內容!

您可能感興趣的文章:
  • Python中matplotlib如何改變畫圖的字體
  • Python制作動態字符畫的源碼
  • Python生成截圖選餐GIF動畫
  • 教你如何利用python3爬蟲爬取漫畫島-非人哉漫畫
  • 教你用Python爬取英雄聯盟皮膚原畫

標簽:七臺河 雅安 渭南 許昌 濰坊 西安 辛集 贛州

巨人網絡通訊聲明:本文標題《如何用Python畫一些簡單形狀你知道嗎》,本文關鍵詞  如,何用,Python,畫,一些,簡單,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《如何用Python畫一些簡單形狀你知道嗎》相關的同類信息!
  • 本頁收集關于如何用Python畫一些簡單形狀你知道嗎的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 乌兰察布市| 滦南县| 张家港市| 凤台县| 隆安县| 大荔县| 晋中市| 三江| 福建省| 云安县| 盈江县| 内江市| 广元市| 福安市| 淮阳县| 饶平县| 新津县| 阿瓦提县| 青铜峡市| 岳阳市| 阿鲁科尔沁旗| 梅州市| 绥化市| 米易县| 封丘县| 康马县| 拜城县| 综艺| 莫力| 五指山市| 麻阳| 河南省| 南溪县| 松阳县| 饶阳县| 肥东县| 宜春市| 勐海县| 游戏| 新密市| 深泽县|