IT 116: Introduction to Scripting
Class 20 Exercise
Script for this exercise
Open a text editor
You can use the editor built into IDLE or use a program like Sublime.
Copy the text below into the file
Save the file as
ex20.py
Copy the file
temps.txt
from
/home/ghoffman/course_files/it116_files
Use FileZilla to do this.
Run this script in IDLE
Open the script file in IDLE. Under the Run menu, select Run Module.
Filename:
xxxx
Cannot open xxxx Filename:
temps.txt
Average: 77.27
The text in
blue
is user input.
Copy the file to Unix
Open FileZilla and connect to
pe15.cs.umb.edu
You will have to connect using your Unix username and password.
Copy the file to the to
it116/ex/ex20
Copy
temps.txt
from
/home/ghoffman/course_files/it116_files/
to your
ex20
directory
Make the script executable
Right-click on the file and select "Permissions" from the menu
Enter 755 in the box provided
Copy
temps.txt
from the same directory where you created
ex20.py
to your
ex20
directory
Running my test script on your script (Optional)
If you want to run my text script on your Class Exercise script do the following
Connect to
pe15.cs.umb.edu
Use an ssh client.
Run my test code on your script
~ghoffman/it116_test/ex20.sh
The script will prompt you for your Unix username.