Terminal.app
followed by the Enter key.python
command. You should see something like this:>>>
prompt, type the statement import pygame
followed by the Enter key. If Python generates no error messages, then you have installed Pygame properly.>>>
prompt, type exit()
followed by the Enter key to exit Python./Users/yourusername/Downloads
directory.Note: The Mac Finder application uses the term folder to mean a container of documents and, perhaps, other folders. This document instead uses the equivalent Unix term directory. |
/Users/yourusername/Downloads/introcs-1.0.zip
file to unzip the file, thus creating a directory named /Users/yourusername/Downloads/introcs-1.0
./Users/yourusername
. In the Terminal window issue the cd Downloads
command to change your working directory to /Users/yourusername/Downloads
, and then issue the cd introcs-1.0
command to change your working directory to /Users/yourusername/Downloads/introcs-1.0
. (Incidentally, the cd ..
command changes your working directory to the 'parent' of the current working directory.)ls
command to display the names of all files in your working directory. Make sure that a file named setup.py
is in your working directory.python setup.py install --user
command. The computer copies the files defining the booksite modules to a directory where Python can find them, and writes status messages to your Terminal window to indicate its progress.python
command.>>>
prompt, type the statement import stdio
followed by the Enter key. If Python generates no error messages, then you have installed the booksite library properly.>>>
prompt, type exit()
followed by the Enter key to exit Python.idle
to launch IDLE./Users/yourusername/hello
.cd hello
command to make the /Users/yourusername/hello
directory your working directory.idle &
to launch IDLE. Note the trailing ampersand. The trailing ampersand tells the computer to run the idleX
program in the background, thereby leaving your Terminal application free to handle additional commands while IDLE is running.helloworld.py
in the directory /Users/yourusername/hello
. The file name is case sensitive, so make sure you use all lowercase letters.ls
command to display the names of all files in the working directory. Confirm that the working directory contains your helloworld.py
file.python helloworld.py
command to run your program. If the computer writes 'Hello, World' to the Terminal window, then the execution of your helloworld.py
program was successful. If the computer instead writes error messages, then use IDLE to correct your program, and issue the python helloworld.py
command again. Repeat until your program runs successfully. If your program runs successfully the first time you try, then intentionally introduce an error into your program, just so you get some experience with correcting errors./Users/yourusername/Downloads
directory./Users/yourusername/Downloads/introcs-python.zip
file, thus creating the /Users/yourusername/Downloads/introcs-python
directory containing the booksite example programs. (It's OK to delete the /Users/yourusername/Downloads/introcs-python.zip
file after you have unzipped it.)cd Downloads
and cd introcs-python
commands to make /Users/yourusername/Downloads/introcs-python
your working directory.ls
command. Confirm that the working directory contains a file named bouncingball.py
.python bouncingball.py
command. If Python launches a stddraw window showing an animated bouncing ball, then your download of the booksite example programs was successful./Users/yourusername/Downloads
directory./Users/yourusername/Downloads/introcs-data.zip
file, thus creating the /Users/yourusername/Downloads/introcs-data
directory containing the booksite example data files. (It's OK to delete the /Users/yourusername/Downloads/introcs-data.zip
file after you have unzipped it.)/Users/yourusername/Downloads
directory./Users/yourusername/Downloads/stdlib-python.zip
file, thus creating the /Users/yourusername/Downloads/stdlib-python
directory containing the booksite library. (It's OK to delete the /Users/yourusername/Downloads/stdlib-python.zip
file after you have unzipped it.)ImportError: No module named stddraw
when I issue the command python program_that_uses_stddraw.py
?python2.7 program_that_uses_stddraw.py
, as described above./Users/yourusername/Downloads
.