Python中图形(turtle)用法
2016-02-19 16:31
696 查看
turtle来导入图形模块,Pen()函数用来创建一个画布。
left()
right()
forward() #向前
backward() # 向后
up() # 抬起画笔,让海龟停止作画
down() # 落下画笔,开始作画
# 先导入turtle这个模块,然后创建了一个正方形 >>> import turtle >>> t=turtle.Pen() >>> t.forward(50) >>> t.left(90) >>> t.forward(50) >>> t.left(50) >>> t.left(40) >>> t.forward(50) >>> t.left(90) >>> t.forward(50) >>> t.reset
left()
right()
forward() #向前
backward() # 向后
up() # 抬起画笔,让海龟停止作画
down() # 落下画笔,开始作画
相关文章推荐
- Python——判断和循环
- Python基础篇【第5篇】: Python模块基础(一)
- python中的exec、eval和repr
- Python 多线程抓取图片效率实验
- Python
- 使用ipython %matplotlib inline
- python类中一些特殊的方法
- python实现的ftp自动上传下载程序(支持目录递归操作)----转
- Python之闭包应用小游戏Tic Tac Toe
- Python安装Numpy,SciPy和MatplotLib
- [python实用代码片段]python获取当前时间的前一天,前一周,前一个月
- Twisted
- Python matplotlib高级绘图详解
- Python基础篇【第3篇】: Python正则表达式
- Python基础篇【第3篇】: Python异常处理、反射、动态导入、利用反射的web框架
- Python中range()函数的使用方法总结
- Python学习之路(1)--python运行三种方式
- python+selenium实现登录账户后自动点击
- 闲来无事,用python练习一下排序算法,\(0^◇^0)/
- 用python读取excel