1 # drawSnake
2 import turtle
3 def drawSnake(rad,angle,len,neckrad):
4 for i in range(len):
5 turtle.circle(rad,angle)
6 turtle.circle(-rad,angle)
7 turtle.circle(rad,angle/2)
8 turtle.fd(rad)
9 turtle.circle(neckrad+1,180)
10 turtle.fd(rad*2/3)
11
12 def main():
13 turtle.setup(1300,800,0,0)
14 pythonsize=30
15 turtle.pensize(pythonsize)
16 turtle.pencolor("blue")
17 turtle.seth(-40)
18 drawSnake(40,80,5,pythonsize/2)
19
20 main()

效果如下:

drawPython的更多相关文章

随机推荐

  1. CH模拟赛 拆地毯

    /* MST,注意只能加K条边,但是备选是M条边 */ #include<iostream> #include<cstdio> #include<string> # ...

  2. x:Array的使用

    x:Array是通过Items属性向使用者暴露一个类型已知的ArrayList.ArrayList中成员类型由x:Array type指明 <Window x:Class="demo_ ...

  3. Create a new Windows service on windows server2012

    netsh http add iplisten ipaddress=0.0.0.0:15901 sc.exe create "FPPService" binPath= " ...

  4. C和指针 第十五章 习题

    15.8 十六进制倾印码 #include <stdio.h> #include <stdlib.h> #include <string.h> #include & ...

  5. 搭建zookeeper集群

    简介: Zookeeper 分布式服务框架是 Apache Hadoop 的一个子项目,它主要是用来解决分布式应用中经常遇到的一些数据管理问题,如:统一命名服务.状态同步服务.集群管理.分布式应用配置 ...

  6. web自动化工具-liveStyle

    web自动化工具-liveStyle LiveStyle. The first bi-directional real-time edit tool for CSS, LESS and SCSS主要用 ...

  7. 兼容8事件绑定与解绑addEventListener、removeEventListener和ie的attachEvent、detachEvent

    兼容8事件绑定与解绑addEventListener.removeEventListener和ie的attachEvent.detachEvent   ;(function(){ // 事件绑定 bi ...

  8. 【河北省队互测】 gcd BZOJ 2818

    Description 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的 数对(x,y)有多少对. Input 一个整数N Output 如题 Sample Input 4 Sa ...

  9. 高性能MySQL(一):基本数据类型

    更多交流及资料,请加群 :

  10. Anaconda 用于科学计算的 Python 发行版

    用于科学计算的 Python 发行版: 1.Anaconda  https://www.continuum.io/    公司continuum.  有商业版本. Anaconda is the le ...