zoukankan      html  css  js  c++  java
  • python 绘图加上文字

    import turtle
    t = turtle.Pen()
    turtle.bgcolor("black")
    
    
    my_name=turtle.textinput("输入你的姓名","你的名字?")
    colors=["red","yellow","purple","blue"]
    for x in range(100):
        t.pencolor(colors[x%4])
        t.penup()
        t.forward(x*4)
        t.pendown()
        t.write(my_name,font=("Arial",int((x+4)/4),"bold"))
        t.left(92)
    #SquareSpiral1.py
    import turtle
    t = turtle.Pen()
    turtle.bgcolor("black")
    sides=6
    colors=["red","yellow","green","blue","orange","purple"]
    for x in range(360):
        t.pencolor(colors[x%sides])
        t.forward(x*3/sides+x)
        t.left(360/sides+1)
        t.width(x*sides/200)
    
    
    print("####结束####")
    
    #
    # ————————————————
    # 版权声明:本文为CSDN博主「qq_14961401」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    # 原文链接:https://blog.csdn.net/qq_14961401/article/details/58595783
  • 相关阅读:
    Lake Counting
    部分和问题
    迷宫最短路
    sublime 的使用技巧
    数组
    Factorial Trailing Zeroes
    Top K Frequent Elements
    Number of Connected Component in An Undirected Graph
    Zigzag Iterator
    Single Number III
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12088817.html
Copyright © 2011-2022 走看看