个人心得:python这么火是有他的原因的,突然发现他的语言很有趣,库函数也很多。

这次是第一步,简单了解了一下turtle函数

  1. import turtle
  2. import time
  3.  
  4. def drawSnake(rad, angle, len,neckrad ):
  5. for i in range(len):
  6. turtle.circle(rad,angle)
  7. turtle.circle(-rad,angle)
  8. turtle.circle(rad,angle/2)
  9. turtle.fd(rad)
  10. turtle.circle(neckrad+1, 180)
  11. turtle.fd(rad/2*3)
  12. def drakSnack_c(rad,len):
  13. turtle.seth(0)
  14. turtle.fd(rad)
  15. turtle.seth(120)
  16. turtle.fd(rad)
  17. turtle.seth(240)
  18. turtle.fd(rad)
  19. turtle.fd(50)
  20. turtle.circle(len*2)
  21.  
  22. def main():
  23. turtle.setup(0.85,0.6,0,0)
  24. pythonsize = 1
  25. speed = 5
  26. turtle.speed(speed)
  27. turtle.pensize(pythonsize)
  28. #turtle.pencolor("red")
  29. #turtle.seth(-40)
  30. #drawSnake(40,80,5,pythonsize/2)
  31. getflower()
  32.  
  33. def text():
  34. turtle.write("hello world!",font=("Arial",23,"bold"))
  35. time.sleep(2)
  36.  
  37. def getflower():
  38. turtle.bgpic("timg.gif")
  39. turtle.color("red","yellow")
  40. turtle.begin_fill();
  41. for i in range(50):
  42. turtle.fd(200)
  43. turtle.left(170)
  44. turtle.end_fill()
  45. time.sleep(2)
  46.  
  47. main()

turtle海龟作图的更多相关文章

  1. 开个小灶——turtle 海龟图形

    turtle 海龟图形 turtle数据库是python语言中最流行的绘制函数图形的数据库,绘制笔头像个小海龟,因此一般称为 海龟图形.海龟数据库的导入   import turtle 1 画布大小设 ...

  2. 小白学Python(20)—— Turtle 海龟绘图

    Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x.纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行 ...

  3. turtle海龟库

    •turtle的使用 #设置窗体大小 startx,starty非必需,默认在屏幕中间 turtle.setup(width,height,startx,starty) #海龟到(x,y)坐标 tur ...

  4. 递归可视化之汉诺塔的动画实现(turtle海龟)

    import turtle class Stack: def __init__(self): self.items = [] def isEmpty(self): def push(self, ite ...

  5. 海龟绘图turtle模块的使用

    在本章中,我们将编写简短的.简单的程序来创建漂亮的.复杂的视觉效果.为了做到这一点,我们可以使用海龟作图软件.在海龟作图中,我们可以编写指令让一个虚拟的(想象中的)海龟在屏幕上来回移动.这个海龟带着一 ...

  6. python之海龟绘图

    1. 基本功能介绍 在海龟作图中,我们可以编写指令让一个虚拟的(想象中的)海龟在屏幕上来回移动.这个海龟带着一只钢笔,我们可以让海龟无论移动到哪都使用这只钢笔来绘制线条.通过编写代码,以各种很酷的模式 ...

  7. Python语言程序设计(3)--实例2-python蟒蛇绘制-turtle库

    1. 2. 3.了解turtle库 Turtle,也叫海龟渲染器,使用Turtle库画图也叫海龟作图.Turtle库是Python语言中一个很流行的绘制图像的函数库.海龟渲染器,和各种三维软件都有着良 ...

  8. 初始Turtle

    ---恢复内容开始--- turtle库介绍 海龟作图最初源自20世纪60年代的Logo(创建于1967年,是一种教育编程语言)编程语言. 常用函数说明 画笔的属性 设置画笔的宽度   t.pensi ...

  9. turtle 20秒画完小猪佩奇“社会人”

    转载:https://blog.csdn.net/csdnsevenn/article/details/80650456 图片源自网络 作者 丁彦军 如需转载,请联系原作者授权. 今年社交平台上最火的 ...

随机推荐

  1. xdebug 常用函数

    转自:http://blog.csdn.net/samxx8/article/details/7050282 string xdebug_call_class()返回当前被调用的函数或方法所属的类的类 ...

  2. shell基本认识

    shell基本认识 bash # echo $BASH /bin/bash 第一个shell脚本first_shell.sh #!/bin/bash echo "Hello world!&q ...

  3. springboot统一异常处理及返回数据的处理

    一.返回code数据的处理 代码: Result.java /** * http请求返回的最外层对象 * Created by 廖师兄 * 2017-01-21 13:34 */ public cla ...

  4. angular中的cookies与cookieStore区别

    设置cookie用put()方法: $cookies.put(key, value[, options]); $cookieStore.put(key, value); 例如设置一个cookie,名为 ...

  5. Python读取指定文件夹(包括当前目录、子目录、子文件)

    http://blog.csdn.net/lsq2902101015/article/details/51305825

  6. Eclipse-环境搭建(缅怀篇)

    JDK 下载jdk安装并配置环境变量运行java -version查看是否安装配置成功 Eclipse 下载eclipse,直接解压到目录 eclipse配置jre 设置complie编译等级 Ecl ...

  7. Nginx 出现413 Request Entity Too Large得解决方法

    Nginx 出现413 Request Entity Too Large得解决方法 默认情况下使用nginx反向代理上传超过2MB的文件,会报错413 Request Entity Too Large ...

  8. garylog学习篇

    官方文档:https://www.graylog.org/ 简介 Graylog 是一个简单易用.功能较全面的日志管理工具,相比 ELK 组合, 优点: 部署维护简单查询语法简单易懂(对比ES的语法… ...

  9. URAL 1830 Help in the RNOS 思路,读题 难度:1

    http://acm.timus.ru/problem.aspx?space=1&num=1830 这道题需要理解题目操作的意思, 要更改第i位的状态,第i-1位必须激活为1,0-i-2位必须 ...

  10. 【2018多校第一场】hdu6308-Time Zone(日期)

    Problem Description Chiaki often participates in international competitive programming contests. The ...