After the lab, you should know how to
.bashrc
with jEdit.
jedit .bashrc
to open
the file.
PS1='[\u@\h \W]> '
export PS1
source .bash_profile
You should see a change to your prompt. It should look something like:
[username@machine ~]$
The ~ represents your home directory. When you change directories, your prompt will reflect those changes.
From now on, whenever you open a new terminal/shell, your prompt should look like this.
lab2
in your
labs
directory. Your programs and the output for this lab
will all be saved in the lab2
directory.
/home/courses/cs111/handouts/lab2
into your lab2
directory.
modula
) by using the command:
ssh modula
Say yes when it asks you about the RSA fingerprint.
Enter your password.
who
to see who else is logged into
the machine. Copy the output from this command into a file called
"linux_practice.txt" in the lab2
directory. Label the
output appropriately.
top
to see how different users are
using the machine's resources. In the file
linux_practice.txt
, note about how much CPU and Memory
is being used and how the resource usage changes as other people
login and use modulo
as well.
sum_square.py
program using the command:
cat sum_square.py
sum_square.py
program.
top
again to see if users are
using the system differently. Note any observations in
linux_practice.txt
We'll practice writing several Python programs, each in their own text file. Name the files lab2.1.py through lab2.6.py.
Your programs will be graded on correctness, style, and how well you tested them. Make sure you adhere to the good development and testing practices we discussed in class. Your code should be readable and your output should be useful and well-formatted.
After you've developed a correct solution to each program, restart IDLE or close and reopen the IDLE "shell" by running the program again (using F5), demonstrate that the program works using several good test cases, and save the output to a file named lab2.x.out, where x is the problem number.
CISC111 Tennis Pros ----------------------------- ft/s mi/hr Laura ---- ---- Jennifer ---- ---- Venus ---- ----
Example output:
x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | --------------------------------------------------------------- 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 2 | 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 |
for
loops, a variable with value "She
loves you," and another variable with value "yeah", print out the
Beatles lyrics:
She loves you, yeah, yeah, yeah She loves you, yeah, yeah, yeah She loves you, yeah, yeah, yeah Yea-aahh
turnin
directory.
(Review the UNIX handout if you don't
remember how to do that.)
printLab.sh
command:
printLab.sh <labdirname>
Again, you should probably print from the labs
directory.
Print the file using the lpr
command introduced in the
first lab.
Labs are due at the beginning of Friday's class. You should hand
in the printed copy at the beginning of class, and the electronic
version should be in the turnin
directory before 2:25
p.m. on Friday.
Ask well before the deadline if you need help turning in your assignment!