Programming Digital Media

Class directory structure

The best way to start writing software is to edit an existing program that works correctly. If you make a change to a program that works and now it doesn't work anymore, you know you did something wrong. This is pleasingly obvious — you can go back to the way it was before you made the mistake and try again. Writing a new program completely from scratch can be difficult in the beginning.

Thoughout the class, we'll be downloading Python programs and other software that we'll use as a basis for our work. To keep all this organized, we'll create a set of directories for the main topics of the class in which we'll download software and in which we'll put our new programs. Later on, we'll talk about other ways of managing our work.

Making directories for our work in the class

  1. First, change your current directory to your home directory by entering cd in the shell.
  2. Create the directory for the class, called "pdm".
            mkdir pdm 
    
    Now when you list the files in your home directory you'll see the new pdm directory.
            ls -l 
    
    Don't forget that you can also start the Finder on the current directory with the open command.
            open . 
    
  3. Change the current directory to the pdm directory you just created.
            cd pdm 
    
  4. Make a separate directory for our initial set of class topics. You can specify several directories to mkdir at once.
            mkdir python image animation sound 
    
    Now enter ls -l and you should see those four directories.
In our next tutorial, we'll copy some simple Python scripts into the python directory we made.