当前位置: 首页>>代码示例>>Python>>正文


Python turtle.circle函数代码示例

本文整理汇总了Python中turtle.circle函数的典型用法代码示例。如果您正苦于以下问题:Python circle函数的具体用法?Python circle怎么用?Python circle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了circle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: displaySqaure

def displaySqaure(x, y):
    turtle.penup()
    turtle.goto(x - 100, y - 100)
    turtle.pendown()
    turtle.begin_fill()
    turtle.circle(50, steps=4)
    turtle.end_fill()
开发者ID:EthanSeaver,项目名称:Python-Projects,代码行数:7,代码来源:HandleMouseRelease.py

示例2: polygon

def polygon(side = 50, angle = None, xstart = None, ystart = None, numberSides = 3, color = 'black', fill = False):
    turtle.pensize(3)
    turtle.speed('fastest')
    turtle.hideturtle()
    if angle != None:
        turtle.left(angle)
    
    turtle.penup()
    if fill == True:
        if xstart != None or ystart != None:
            turtle.goto(xstart, ystart)
        else:
            turtle.goto(0, 0)
        turtle.color(color)
        turtle.pendown()
        turtle.begin_fill()
        turtle.circle(side, 360, numberSides)
        turtle.end_fill()
        turtle.penup()
        
    else:
        turtle.goto(xstart, ystart)
        turtle.color(color)
        turtle.pendown()
        turtle.circle(side, 360, numberSides)
        turtle.penup()
    
    return
开发者ID:JakenHerman,项目名称:python-homework,代码行数:28,代码来源:GraphicsAndPatternLibrary.py

示例3: hang

def hang():
	turtle.speed(0)
	if stage[0]==0:
		go_to(-300,0,0)
		turtle.forward(600)
		go_to(-100,0, 90)
		turtle.forward(200)
		turtle.right(90)
		turtle.forward(100)
		turtle.right(90)
		turtle.forward(25)
	elif stage[0]==1:
		go_to(0, 150, 0)
		turtle.circle(12.5)
	elif stage[0]==2:
		go_to(0,150, -90)
		turtle.forward(50)
	elif stage[0]==3:
		go_to(0,140, -45)
		turtle.forward(25)
		go_to(0,140, -135)
		turtle.forward(25)
	elif stage[0]==4:
		go_to(0,100, -45)
		turtle.forward(25)
		go_to(0,100, -135)
		turtle.forward(25)
	stage[0]+=1
	return 0
开发者ID:BCasaleiro,项目名称:Hangman,代码行数:29,代码来源:hangman.py

示例4: rand_circle

def rand_circle():
    color = choice(colors)
    turtle.color(color, color)
    radius = randint(10, 100)
    turtle.begin_fill()
    turtle.circle(radius)
    turtle.end_fill()
开发者ID:lvidarte,项目名称:python-raspberry,代码行数:7,代码来源:turtle-4.py

示例5: circle

def circle(x,y,size):
	turtle.pu()
	turtle.goto(x,y)
	turtle.pd()
	turtle.begin_fill()
	turtle.circle(size)
	turtle.end_fill()
开发者ID:ameen16-meet,项目名称:MEET-YL1,代码行数:7,代码来源:ameenproject.py

示例6: circle

def circle(a,b):
    turtle.color("green")
    turtle.pu()
    turtle.goto(a,b)
    turtle.pd()
    turtle.setheading(90)
    turtle.circle(40)
开发者ID:DCoelhoM,项目名称:Tic-Tac-Toe-Python,代码行数:7,代码来源:Tic-Tac-Toe_by_DCM.py

示例7: drawCircleAt

def drawCircleAt(turtleX, turtleY, circleSize):
    turtle.penup()
    turtle.goto(turtleX,turtleY)
    turtle.pendown()
    turtle.begin_fill()
    turtle.circle(circleSize)
    turtle.end_fill()
开发者ID:cparker,项目名称:pythonclub,代码行数:7,代码来源:one.py

示例8: stam

def stam(x,y):
    turtle.begin_fill()
    turtle.pu()
    turtle.goto(x,y)
    turtle.pd()
    turtle.circle(10)
    turtle.end_fill()
开发者ID:dina16-meet,项目名称:MEET-YL1,代码行数:7,代码来源:dina.py

示例9: draw

 def draw(self):
     turtle.forward(self.radius)
     turtle.left(90)
     turtle.circle(self.radius, extent=self.angle)
     turtle.left(90)
     turtle.forward(self.radius)
     turtle.done()
开发者ID:tbemsi,项目名称:Intro-Python-AIMS,代码行数:7,代码来源:objects.py

示例10: drawCircle

def drawCircle(x = 0, y = 0, radius = 10, mycolor = (0.49, 0.99, 0.00)): # Lawn Green
    turtle.pencolor(mycolor[0], mycolor[1], mycolor[2])
    turtle.pensize(4)
    turtle.penup()
    turtle.goto(x, y - radius)
    turtle.pendown()
    turtle.circle(radius)
开发者ID:mbernadette,项目名称:Designs,代码行数:7,代码来源:LoveKnots.Maria.Johnson.py

示例11: drawFlower

def drawFlower(xCenter = 0, yCenter = 0, xRightUp = 0, yRightUp = 0,
    xRightDown = 0, yRightDown = 0, xLeftUp = 0, yLeftUp = 0,
    xLeftDown = 0, yLeftDown = 0, radius = 10):
    turtle.pensize(3)
    turtle.color(1.0, 0.41, 0.70) # Hot Pink
    turtle.penup()
    turtle.goto(xCenter, yCenter - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xRightUp, yRightUp - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xRightDown, yRightDown - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xLeftUp, yLeftUp - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xLeftDown, yLeftDown - radius)
    turtle.pendown()
    turtle.circle(radius)
开发者ID:mbernadette,项目名称:Designs,代码行数:25,代码来源:LoveKnots.Maria.Johnson.py

示例12: draw_move

def draw_move(turtle, cell_size, offset, domino, dx, dy, move_num, step_count):
    shade = (move_num-1) * 1.0/step_count
    rgb = (0, 1-shade, shade)
    turtle.forward((domino.head.x-offset[0]) * cell_size)
    turtle.left(90)
    turtle.forward((domino.head.y-offset[1]) * cell_size)
    turtle.right(90)
    turtle.setheading(domino.degrees)
    turtle.forward(cell_size*.5)
    turtle.setheading(math.atan2(dy, dx) * 180/math.pi)
    pen = turtle.pen()
    turtle.pencolor(rgb)
    circle_pos = turtle.pos()
    turtle.width(4)
    turtle.forward(cell_size*0.05)
    turtle.down()
    turtle.forward(cell_size*0.4)
    turtle.up()
    turtle.pen(pen)
    turtle.setpos(circle_pos)
    turtle.forward(8)
    turtle.setheading(270)
    turtle.forward(8)
    turtle.left(90)
    turtle.down()
    turtle.pencolor(rgb)
    turtle.fillcolor('white')
    turtle.begin_fill()
    turtle.circle(8)
    turtle.end_fill()
    turtle.pen(pen)
    turtle.write(move_num, align='center')
    turtle.up()
开发者ID:donkirkby,项目名称:donimoes,代码行数:33,代码来源:diagram.py

示例13: display

	def display(self):
		turtle.penup()
		print(self.x, self.y)
		turtle.goto(self.x,self.y)
		turtle.pendown()
		turtle.circle(self.r)
		turtle.penup()
开发者ID:strommer,项目名称:Python_rpi,代码行数:7,代码来源:ex09.py

示例14: drawPoint

def drawPoint(x, y):
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()
    turtle.begin_fill()
    turtle.circle(3)
    turtle.end_fill()
开发者ID:flyerooo,项目名称:learnpy,代码行数:7,代码来源:py_eg.py

示例15: drawEyes

def drawEyes():
    """
    Draw the pair of eyes.
    :pre: (relative) pos (0,0), heading (east), up
    :post: (relative) pos (0,0), heading (east), up
    :return: None
    """
    # left eye
    turtle.forward(10)
    turtle.left(90)
    turtle.forward(10)
    turtle.right(90)
    turtle.down()
    turtle.begin_fill()
    turtle.circle(5)
    turtle.end_fill()
    turtle.up()

    # right eye
    turtle.forward(30)
    turtle.down()
    turtle.begin_fill()
    turtle.circle(5)
    turtle.end_fill()
    turtle.up()

    # return back
    turtle.back(30)
    turtle.left(90)
    turtle.back(10)
    turtle.right(90)
    turtle.back(10)
开发者ID:RIT-2015,项目名称:CPS,代码行数:32,代码来源:snack.py


注:本文中的turtle.circle函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。