import turtle

turtle.setup(600,400,0,0)
turtle.bgcolor('red')
turtle.color('yellow')
turtle.fillcolor('yellow') def mygoto(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down() def draw(l):
turtle.begin_fill()
for i in range(5):
turtle.forward(l)
turtle.right(144)
turtle.end_fill() mygoto(-250,100)
draw(100) for i in range(4):
x=1
if i in [0,3]:
x=0
mygoto(-100+x*50,150-i*47)
turtle.left(15-i*15)
draw(30) mygoto(0,0)
turtle.hideturtle()
# print(time.clock()) turtle.done()

  

Pycharm画五角星的更多相关文章

  1. 【Python】【demo实验29】【练习实例】【使用turtle画五角星】

    原题: 使用turtle画五角星: 我的代码: #!/usr/bin/python # encoding=utf-8 # -*- coding: UTF-8 -*- from turtle impor ...

  2. CSS3画五角星和六角星

    最终想要实现的效果 一.五角星 在画五角星之前首先分析这个五角星是如何实现,由哪几个部分构成的,示意图如下: 三个顶角向上的三角形,通过设置旋转和定位相互重叠和拼接实现最终的五角星效果. 为了语义化和 ...

  3. 【openGL】画五角星

    #include "stdafx.h" #include <GL/glut.h> #include <stdlib.h> #include <math ...

  4. 在unity的scene中画五角星

    使用Gizmos的DrawLine方法画线. 首先在场景中找到五角星的五个定点的坐标,按照一笔画的顺序命名为1,2,3,4,5,如图所示: 接下来就是编写代码了,代码很少,如下所示: using Un ...

  5. canvas画画板,canvas画五角星,canvas制作钟表、Konva写钟表

    制作一个画画板,有清屏有橡皮擦有画笔可以换颜色 style样式 <head> <meta charset="UTF-8"> <title>画画板 ...

  6. PHP学习笔记(4)GD库画五角星

         <?php //加header头,不然浏览器乱码 header("content-type: image/png"); //创建画布资源 $img = imagec ...

  7. 由python工作区导致的python代码能运行,但是PyCharm画红线的问题

    原文:https://www.zhihu.com/question/63028700 PyCharm在遇到模块找不到时,会使用红色波浪线提醒开发者. Python有一个工作区的概念,在默认情况下,当你 ...

  8. 用CSS画五角星

    <!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8" ...

  9. 3.用Python画五角星

    import turtleimport timeimport os #def draw_square(org_x, org_y, x, y): turtle.setpos(org_x, org_y) ...

随机推荐

  1. Codeforces Round #550 (Div. 3) F. Graph Without Long Directed Paths

            F. Graph Without Long Directed Paths time limit per test 2 seconds memory limit per test 256 ...

  2. CNN解析和模型分析

    https://wenku.baidu.com/view/b0add84eb94ae45c3b3567ec102de2bd9605de8a.html?pn=51 http://www.cnblogs. ...

  3. poj1847 Tram(最短路dijkstra)

    描述: Tram network in Zagreb consists of a number of intersections and rails connecting some of them. ...

  4. 漫画:一招学会TCP的三次握手和四次挥手

    TCP三次握手和四次挥手的问题在面试中是最为常见的考点之一.很多读者都知道三次和四次,但是如果问深入一点,他们往往都无法作出准确回答. 本篇尝试使用动画来对这个知识点进行讲解,期望读者们可以更加简单地 ...

  5. 2018-2019-2 网络对抗技术 20165206 Exp4 恶意代码分析

    - 2018-2019-2 网络对抗技术 20165206 Exp4 恶意代码分析 - 实验任务 1系统运行监控(2分) (1)使用如计划任务,每隔一分钟记录自己的电脑有哪些程序在联网,连接的外部IP ...

  6. 使用Python批量下载Plus上的Podcast

    Plus是一个介绍数学之美与实际应用的网络杂志,其中包含了数学知识.轶闻趣事.历史典故等许多精彩的内容.该杂志恰好有一个Podcast栏目,提供了不少采访与讲座的mp3音频.于是, 我使用Python ...

  7. No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing instance of type Test (e.g. x.new A() where x is an instance of Test).

    Java编写代码过程中遇到了一个问题,main方法中创建内部类的实例时,编译阶段出现错误,查看错误描述: No enclosing instance of type Test is accessibl ...

  8. jdbc crud

    最近在做一个mybatis的sql审计,所有需要原生的使用一下jdbc,基于次,复习一下自己的基础知识 github 地址: https://github.com/warriorg/nodes/tre ...

  9. redis安装使用

    Redis是一个开源的使用ANSI C语言编写.遵守BSD协议.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API. 它通常被称为数据结构服务器,因为值(valu ...

  10. Codeforces 581F Zublicanes and Mumocrates 树形dp

    Zublicanes and Mumocrates dp[ i ][ j ][ k ] 表示 以 i 为根的子树, 占领 i 的 是 j 并且第一个人占了 i 子树的 k 个叶子节点的最小值. 然后随 ...