llgd.net
当前位置:首页 >> python turtlE >>

python turtlE

简介:turtle是一个简单的绘图工具。它提供了一个海龟,你可以把它理解为一个机器人,只听得懂有限的指令。 1.在文件头写上如下行,这能让我们在语句中插入中文 #-*- coding: utf-8 -*- 2.用import turtle导入turtle库 3.绘图窗口的原点(0,0)在...

画布(canvas) turtle.screensize(800, 600, "green") turtle.screensize() #返回默认大小(400, 300) 画笔控制命令: turtle.down() #移动时绘制图形,缺省时也为绘制 turtle.up() #移动时不绘制图形 turtle.pensize(width) #绘制图形时的宽度 turt...

是要表白么,嘿嘿,希望这个代码能帮到你哦~(参数不满意可以自己调) import turtleimport mathwn = turtle.Screen()wn.setworldcoordinates(-2, -2, 2, 2)alex = turtle.Turtle()alex.color("red")alex.pensize(2)alex.penup()alex.speed(0)wa...

turtle.color(*args)Return or set pencolor and fillcolor. Several input formats are allowed. They use 0 to 3 arguments as follows: color() Return the current pencolor and the current fillcolor as a pair of color specification st...

是要表白么,嘿嘿,希望这个代码能帮到你哦~(参数不满意可以自己调) import turtle import math wn = turtle.Screen() wn.setworldcoordinates(-2, -2, 2, 2) alex = turtle.Turtle() alex.color("red") alex.pensize(2) alex.penup() alex.sp...

import turtle#draw first circleturtle.penup()turtle.goto(0,-200)turtle.pendown()turtle.circle(200)#draw second circleturtle.penup()turtle.goto(0,-150)turtle.pendown()turtle.circle(150)#draw third circleturtle.penup()turtle.goto...

import turtledef draw(x,y): turtle.clear() while True: turtle.forward(200) turtle.left(144) if abs(turtle.pos()) < 1: breakdraw(0,0)turtle.onscreenclick(draw)turtle.mainloop()

首先 import turtle? 不import没有用的啊 其次 你是想 turtle.forward(100) 吗。。

Turtle motion Move and draw forward() | fd() backward() | bk() | back() right() | rt() left() | lt() goto() | setpos() | setposition() setx() sety() setheading() | seth() home() circle() dot() stamp() clearstamp() clearstamps()...

画了10px, 然后你忘了done(), 所以卡在那里不动了. import turtle turtle.forward(100) #100明显点 turtle.done() 注: turtle模块是用来教学的, 貌似你用它来绘图也没意义吧.

网站首页 | 网站地图
All rights reserved Powered by www.llgd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com