Lessons

Related Links

More Cool Stuff

Python

  • For students in grades 7-8
  • Course Description: Learn to design and build computer programs with Python, a programming language used in undergraduate computer science courses here at Northwestern. Python was the fastest growing computer language of 2010, and an important part of the development of Google. Development in Python is faster than development in Java or C++, and many Python programs run as efficiently as Java programs. Aside from commercial applications, Python is used for prototyping and for tying together modules of Java code or C++ code into a single application.

    To learn more about Python: http://www.python.org/

  • Requirements: A math or reading score at the 95% or higher on a nationally normed test such as the ISATs or NWEA MAPs.
  • Course Dates: December 3, 2011 - December 4, 2011 09:00 AM - 02:30 PM
  • Location: Evanston, IL

Before we start, you need to:

  1. print "Hello, World!"
  2. connect to this web page and run the videos on this page
  3. make sure your headphones work

Installing Python and Pygame on a Mac

Here are the packages used for the installation of Python and Pygame in this course:

from http://www.python.org/ftp/python/2.6.6/
python-2.6.6-macosx10.3.dmg

from http://sourceforge.net/projects/numpy/files/
numpy-1.6.1-py2.6-python.org-macosx10.3.dmg

Building a mac application

So far, I've tracked down three possibilities for creating Mac apps from Python programs:

1. The "Build Applet" tool that's located in the Python 2.6 directory of the IDLE application.
2. py2app, available at http://undefined.org/python/#py2app
3. PyInstaller (http://www.pyinstaller.org/)

Of these three, I've had the most luck with py2app. I followed the directions at http://packages.python.org/py2app/tutorial.html. One problem that might come up is that your app can't find the picture or sound files you included in your game. One way to fix this is to right click on the app file you create and choose "Show Package Contents" from the menu that pops up. Add all your picture or sound files to the Contents/Resources folder and try again.

Let me know if this works for you or if you figure out a better way. Send me an email at tj@tjleone.com. If I find a better solution in the meantime, I'll post it.

Installing Python and Pygame in Windows

If you're running Windows, try installing these:

from http://www.python.org/download/
python-2.7.2.msi

from http://pygame.org/download.shtml
pygame-1.9.2a0.win32-py2.7.msi

Below are videos from Bucky Roberts on installing Python and Pygame in Windows. They were made before 2.7.2 was available for windows, so they show installation of an older version, but I think they would still be helpful to windows users.

Installing Python
Installing Pygame