Skip to main content

Home/ Groups/ Puerto Rico Python Interest Group
Kevin Shockey

HexPlanet Demo - 0 views

Kevin Shockey

cylinder - 0 views

  •  
    "rod = cylinder( pos=vec(0,2,1),                 axis=vec(1,0,0),                 size=vec(5,1,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
Kevin Shockey

Pentagram - Rosetta Code - 0 views

  •  
    "import turtle   turtle.bgcolor("green") t = turtle.Turtle() t.color("red", "blue") t.begin_fill() for i in range(0, 5): t.forward(200) t.right(144) t.end_fill()"
Kevin Shockey

pygame - 0 views

‹ Previous 21 - 40 of 777 Next › Last »
Showing 20 items per page