Skip to main content

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

Rss Feed Group items tagged

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

A simple hangman game made with Python 2.7.3 · GitHub - 0 views

  •  
    "class Hangman(): def __init__(self): print "Welcome to 'Hangman', are you ready to die?" print "(1)Yes, for I am already dead.\n(2)No, get me outta here!" user_choice_1 = raw_input("->") if user_choice_1 == '1': print "Loading nooses, murderers, rapists, thiefs, lunatics..." self.start_game() elif user_choice_1 == '2': print "Bye bye now..." exit() else: print "I'm sorry, I'm hard of hearing, could you repeat that?" self.__init__() def start_game(self): print "A crowd begins to gather, they can't wait to see some real" print "justice. There's just one thing, you aren't a real criminal." print "No, no. You're the wrong time, wrong place type. You may think" print "you're dead, but it's not like that at all. Yes, yes. You've" print "got a chance to live. All you've gotta do is guess the right" print "words and you can live to see another day. But don't get so" print "happy yet. If you make 6 wrong guess, YOU'RE TOAST! VAMANOS!" self.core_game() def core_game(self): guesses = 0 letters_used = "" the_word = "pizza" progress = ["?", "?", "?", "?", "?"] while guesses < 6: guess = raw_input("Guess a letter ->") if guess in the_word and not in letters_used: print "As it turns out, your guess was RIGHT!" letters_used += "," + guess self.hangman_graphic(guesses) print "Progress: " + self.progress_updater(guess, the_word, progress) print "Letter used: " + letters_used elif guess not in the_word and not(in letters_used): guesses += 1 print "Things aren't looking so good, that guess was WRONG!" print "Oh man, that crowd is getting happy, I thought you" print "wanted to make them mad?" letters_used += "," + guess self.hangman_graphic(guesses) print "Progress: " + "".join(progress) print "Letter used: " + letters_used else: print "That's the wrong letter, you wanna be out here all day?" print "Try again!" def hangman_graphic(self, guesse
Kevin Shockey

Mozilla, The New York Times and The Washington Post launch new media collaboration to c... - 0 views

  •  
    "MIAMI - June 19, 2014 - Mozilla, The New York Times and The Washington Post today announced that they are teaming up to build a new content and commenting platform that will allow audiences to more deeply engage with media coverage and help news organizations everywhere better manage user comments and contributions. The online community platform is supported by $3.89 million from the John S. and James L. Knight Foundation."
Kevin Shockey

Best Buy Foundation: National Partnership Request For Proposals - 0 views

  •  
    "Best Buy Ignites Teen Potential through Technology For decades people have turned to Best Buy for answers to their technology questions. As a company, we aim to ignite human potential.  To support these efforts, the Best Buy Foundation provides underserved teens with access to technology to build 21st century skills and bridge the digital divide. As technology becomes more ingrained in our society, it is critical for youth to develop the necessary skills for future college and career success.  Sixty percent of the jobs that will be available in 10 years don't even exist today. As experts in technology, our goal is to leverage our knowledge, resources and talented Best Buy and Geek Squad employees to empower underserved youth and help prepare them for the future.   National Partner Overview Best Buy seeks nonprofit partners that create hands-on learning opportunities for underserved teens to engage them in learning, experimenting, and interacting with the latest technologies to build 21st century skills. The overall goal is to provide youth with access to new technologies and help them become interested and fluent in digital learning while developing skills to help better prepare them for future education and career success. Programs should help teens build 21st century skills by utilizing cutting-edge technology such as computers, digital cameras, video cameras and professional software in a wide range of areas including (but not limited to): Audio production (including music mixing & recording) Coding/3D printing Computer Maintenance and Repair Digital photography/graphic design Filmmaking & videography Maker Faires/hack-a-thons Mobile & game app development Programming Robotics Web site design    Grant Overview Best Buy is searching for national organizations with a demonstrated track record for building skill proficiency in technology through out-of-school time programs. The primary responsibilities of the nonprofit organization include: Workin
Kevin Shockey

pyplot - Matplotlib 1.3.1 documentation - 0 views

  •  
    "matplotlib.pyplot"
1 - 17 of 17
Showing 20 items per page