Skip to main content

Home/ Puerto Rico Python Interest Group/ Group items tagged Python

Rss Feed Group items tagged

Kevin Shockey

Python Turtle Directions - 0 views

  •  
    "from turtle import * color('red', 'yellow') begin_fill() while True: forward(200) left(170) if abs(pos()) < 1: break end_fill() done()"
Kevin Shockey

24.5. turtle - Turtle graphics for Tk - Python v2.7.8 documentation - 0 views

  •  
    "Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966."
Kevin Shockey

Draw faster circles with Python turtle - Stack Overflow - 0 views

  •  
    "from turtle import* speed(0) i=0 while i < 360: forward(1) left(1) i+=1"
Kevin Shockey

Turtle Graphics - 0 views

  •  
    "Turtle Graphics in Python Documentation on Turtle Graphics: This is the ultimate source for all information on this library. Comprehensive List of Colors List of Programs in Turtle Graphics # File: Hello.py # Description: This program writes out Hello World import turtle def main(): # put label on top of page turtle.title ('Hello World') # setup screen size turtle.setup (1000, 1000, 0, 0) # move turtle to origin turtle.penup() turtle.goto (0, 0) # set the color to navy turtle.color ('navy') # write the message turtle.write ('Hello World!', font = ('Times New Roman', 36, 'bold')) # hide the turtle turtle.hideturtle() # persist the drawing turtle.done() main() # File: Squares.py # Description: Draws squares of different sizes import turtle # draw a square of a given side # starting at uuper left corner (x, y) def drawSquare (ttl, x, y, side): ttl.penup() ttl.goto(x, y) ttl.setheading(0) # set the pen in the +ve x direction ttl.pendown() for iter in range (4): ttl.forward(side) ttl.right(90) ttl.penup() def main(): # put label on top of page turtle.title ('Squares') # setup screen size turtle.setup (800, 800, 0, 0) # create a turtle object ttl = turtle.Turtle() # assign a color to the turtle object ttl.color ('red') # draw multiple squares drawSquare (ttl, -50, -50, 50) drawSquare (ttl, 0, 0, 50) drawSquare (ttl, 50, 50, 50) drawSquare (ttl, -50, 50, 150) # fill a closed region ttl.fillcolor ('purple') ttl.begin_fill() drawSquare (ttl, 0, 0, 50) ttl.end_fill() # persist drawing turtle.done() main() # File: Figures.py # Description: Draws various types of geometric figures import turtle, math # draw a line from (x1, y1) to (x2, y2) def drawLine (ttl, x1, y1, x2, y2): ttl.penup() ttl.goto (x1, y1) ttl.pendown() ttl.goto (x2, y2) ttl.penup() def drawPolygon (ttl, x, y, num_side, radius): sideLen = 2 * radius * math.sin (math.pi / num_s
« First ‹ Previous 41 - 60 of 126 Next › Last »
Showing 20 items per page