Hello World!

12 Days of Python – Day 11

Posted: December 22, 2011 at 7:05 am

This is Day 11 of 12 Days of Python. This is the eleventh in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!

For Day 11 we’re going to make the lights blink.

Read More...

12 Days of Python – Day 10

Posted: December 21, 2011 at 4:36 am

This is Day 10 of 12 Days of Python This is the tenth in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!

For Day 10 we’re adding a window to the scene.

Read More...

12 Days of Python – Day 9

Posted: December 20, 2011 at 2:13 pm

This is Day 9 of 12 Days of Python This is the ninth in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!

For Day 9 we’re adding some Presents to the scene. To do this, we draw some rectangles, and we use some randomly-placed circles for “wrapping paper” for the presents.

Read More...

12 Days of Python – Day 8

Posted: December 19, 2011 at 6:55 am

This is Day 8 of 12 Days of Python This is the eighth in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!

For Day 8 we’re adding a picture on the wall behind Santa. This picture will be a computer-generated artwork, just like the one we did in Chapter 16 of our book.

Read More...

12 Days of Python – Day 7

Posted: December 18, 2011 at 6:29 am

This is Day 7 of 12 Days of Python This is the seventh in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway , where you can win a Kindle Touch!

For Day 7 we’re going to add Christmas lights to the scene.

Read More...

12 Days of Python – Day 6

Posted: December 17, 2011 at 6:41 am

This is Day 6 of 12 Days of Python This is the sixth in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway , where you can win a Kindle Touch!

For Day 6 we’re going to add a Christmas tree.

Read More...

12 Days of Python – Day 5

Posted: December 16, 2011 at 4:42 pm

This is Day 5 of 12 Days of Python This is the fifth in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway , where you can win a Kindle Touch!

For Day 5 we’re going to add a background to the scene – walls and a floor. To do this, we draw some polygons filled with different colors.

Read More...

12 Days of Python – Day 4

Posted: December 15, 2011 at 5:52 am

This is Day 4 of 12 Days of Python. This is the fourth in a series of posts where we use Python and the Pygame module to draw a Christmas scene. Each day we add something else to the scene, and we show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!

For Day 4 we’re going to add some code that crosses off the days on the calendar. The code uses your computer’s date to figure out whay day it is, and crosses off all the days on the calendar up to that day. So if you run it every day, you’ll see more and more days crossed off as we get closer to Christmas.

Read More...

12 Days of Python – Day 3

Posted: December 14, 2011 at 5:28 am

Welcome to Day 3 of the 12 Days of Python. This is the third in a series of posts where we will use Python and the Pygame module to draw a Christmas scene. Each day we’ll add something else to the scene, and we’ll show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!.

For Day 3 we’re going to add a calendar to the scene. We draw the calendar using a white rectangle, some lines, and a bunch of Pygame font objects for the text and numbers. We use a for loop to draw the days of the calendar.

Read More...

12 Days of Python – Day 2

Posted: December 13, 2011 at 4:13 am

Welcome to Day 2 of the 12 Days of Python. This is the second in a series of posts where we will use Python and the Pygame module to draw a Christmas scene. Each day we’ll add something else to the scene, and we’ll show a new aspect of Python or Pygame. We’re also having a giveaway, where you can win a Kindle Touch!

For Day 2 we’re going to make Santa’s arm wave.

Read More...