prev next 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Making Your Own Program

A program is just a file with code in it. Let's make one.

  1. Start TextEdit from your Applications folder.
  2. Go to the "Format" menu and say "Make Plain Text".
  3. Now type this in:
#!/usr/bin/env python

print 'time to play hangman'

The first line tells the computer which what language the program is written in: python.

After that, you can write as many lines of python code as you like.

Save the file with the name "game.py" on your desktop.