|
Use our script to install the first project
|
|
The output from sucessfully completing the installation.
If you had already installed it, you would be prompted for
overwriting your existing files.
|
|
Now you should have a stack directory with two files in it.
Stack.py (the file you will be editing) and TestStack.py
(the file you will use to test your stack).
|
 |
A useful IDE for editing and running python is idle. This
command opens Stack.py and TestStack.py.
|
|
This is the Python Shell that opens whenever you run idle.
You can run python commands from within this shell and see
the output. This is a good place to test simple python
statements or run modules.
|
|
This is the Stack file opened in idle. This is where you
will be implementing and/or modifying a stack.
|
|
This is the TestStack file opened in idle. Running this
module will create a stack from your Stack module and
perform commands as specified from test files.
|
|
Click Run > Run Module to run the TestStack.py module.
You can also use the shortcut F5.
|
|
Running the module puts the output into the python shell.
This is the result of printing the stack after each command.
|
|
This is the pop method. You will be modifying this.
|
|
You may have noticed that running modules produces .pyc
files. These are compiled binaries that increase the speed
by which the python files are loaded. However, the speed
of the program is not any faster. You can delete them, but
the next time you run the script, they will be regenerated.
|
|
If you want to run the python modules from the command
line, you will need to make them executable. Right now,
they are only Read and Writeable by the owner of the
files (you).
|
|
Change the permissions by using the chmod command. For
the purposes of this assignment, use chmod 700. If you
want more information about permissions, ask a TA or the
Sunlab consultant.
|
|
Now you can run the script from the command line.
|
|
You can do so by typing TestStack.py (or ./TestStack.py).
|
|
Now you can run the script from the command line.
The test script has some simple options built in.
TestStack --help will show the list of options.
|
|
Run the script.
|
|
Does this output look familiar?
|
|
When you are done, you need to hand in your assignment.
Running cs016_handin stack should do the trick.
|
|
Oh my, you forgot to write a README. Assignments will
not be accepted without a file specifically named README.
|
|
Now that you've written an in-depth, highly descriptive
README documenting any bugs and explaining your
implementation, you can turn it in.
|
|
Congratulations, you handed in the assignment. You
should receive an email shortly after handing in. If you
want to make changes after you hand in, just make your
changes and hand it in again. If you make a change
and hand it in again after the due date, it will be treated
as late.
|