Please feel free to submit any code you feel might be helpful or educational.

Appropriate submissions should not be more than about 500 lines long - if you have something bigger (like a full-fledged sprite management system, or a complete game), you should host it elsewhere and let the pygame mailing list know about it. Similarly, if it's written in python, but it's not really game-related, there are other code advertisement systems (like freshmeat) that would be more appropriate.

That said, the pygame code repository has quite a wide scope for submissions. Your code doesn't necessarily need to depend on pygame; python code that is generally useful in games is fine. Code written in C, but designed for to be imported into a pygame project is fine too. Finally, examples of neat effects or clever algorithms are gratefully accepted.

In order to be posted, your code sample must meet two additional requirements:

  • You must agree to put the code you submit in the public domain. I would hope this goes without saying, but the purpose of the PCR is to share the code. Don't submit it to me unless you want other people to use it! This doesn't mean your game project has to be licensed in the public domain, just the sample you're sending me. After you've sent me the code, you've given up all rights to it, except the right to request it be removed from this site.
  • You must include a text file with your code sample. This file will specify:
    • Your name
    • Your e-mail address
    • A description of the code's purpose
    • Whether or not the code depends on any particular version of pygame, SDL or Python.

As you may have noticed, each submission on this site has a comment attached, and has been colourized. I reserve the right to reformat and edit submitted code for clarity and correctness. I also reserve the right to reject any submission.

There are two ways to submit your code:

  • Upload your .zip, tar.gz or .tgz file by anonymous ftp to:

  • E-mail it as an attachment to: pcr_submit at

I'll check this directory every night, read it until I understand it, colourize it and link it up. It should appear within 3 days of submission. If you have any questions about your submission, please e-mail me, or come find me in #pygame on (I'm Futility).

Main - Repository - Submit - News