pygame is
Simple DirectMedia Layer is
Site Swing

Canasta - 0.2.5

Peter Frase (pefrase)



A computer implementation of the game of Canasta. Can be played in single-player mode, or by multiple players over the Internet. Requires Twisted in addition to python+pygame, but the Windows executable should work out of the box without any additional installs.

I'm a novice at Python, and this is my first attempt at writing a game with it. Canasta is mostly awesome, to me, because of its social aspects, so this program focuses heavily on the multiplayer element. You can start a game and have other players connect to you over the internet, as long as you have an accessible IP address and an open port. A chat window is provided throughout the game for players to communicate with each other.

A one-player game is available as well, although the computer opponents are still in a fairly rudimentary state.

If you don't know how to play Canasta, a Google search will turn up some good explanations. When you start the game, you can hit F1 to see a brief explanation of the controls. There is also a manual included in the form of a text file.


Improvements are mostly in two areas:

-The user interface is now somewhat prettier and more consistent, with all pop-up surfaces using Keebus's GUI library. The chat window, in particular, is improved from previous versions.

-Network gaming has been tightened up, especially in dealing with clients disconnecting and reconnecting. The network game is now more like a chat room, where people can come and go as they please. If new players arrive while a game is in progress, they will be added as observers who can use the chat window, and who will be available to add to the next game. If a player disconnects in the middle of a game, the host has the option of either restarting, or replacing them with a computer player.


Home Page:


click to view original size


Canasta - 0.2.5 - Apr 11, 2009
Canasta - 0.2 - Apr 5, 2009
Canasta - 0.1 - Apr 4, 2009 account Comments

If you wish to leave a comment with your account, please sign in first.

March 26, 2012 12:42pm - Lee MacKinnell - nickname: (feldegast)
i tried to run from source and i got hundreds of indent errors
how was the exe created if the source code doesn't even run?
August 5, 2009 12:24am - Peter Frase - nickname: (pefrase)
Thanks for your comments! I will look into the bug you cite when I do the next update. As for the thickness of the stack, I'll have to think about how to implement that. I don't want to have a card counter because it's not true to the physical game (where you don't actually know exactly how many cards are left), but I'll do something to give an indication of the pile's thickness.
May 26, 2009 8:09pm - Chris Lingle - nickname: (chrisl) - 4/5
For being so early in development this game is quite good. The computer opponent/partner make very few mistakes. One big problem I have with the game is that I don't see the thickness of the stack so I often get caught with meldable cards in my hand. Something as simple as a card counter somewhere would be awsome. You need an undo for something that was melded accidentally. I have only had it hang on me a few times and those have all been when I melded all my cards and no discard and I could not undo anything and clicking on the pile did not pass my turn without a discard.
Otherwise this game rocks! Well done. I have not used the networking portion yet but I am sure that will come soon.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)