Computer Science 111, Fall 2006 Lab #3

September 21, 2006
The purpose of today's lab is to work with counting loops and jython image manipulation. We will start by doing some Linux operations. Boot the machine into Linux.

Part 1. Linux comes with an email application called simply mail. Your quiz answers were emailed to your class account. To read your email answers, save them to a file, and print them out, carefully do the following:

Part 2. Installing jes and jython JES stands for Jython Environment for Students. JES comes with an extensive multimedia API, enabling easy and rapid manipulations of sounds, images, and on some platforms, video. JES was originally designed and implemented by Jason Ergle, Claire Bailey, David Raines, and Joshua Sklare. The second version was implemented by Larry Olson, Toby Ho, Ellie Harmon, Keith McDermott, and Adam Wilson. Jython is a version of the python interpreter that was written in Java. In other words, programmers wrote a program in the Java programming language that runs as a python interpreter. Plain python is generally written in another high-level language called C++.



We are going to install JES and make a small modification so that we can use the classes and methods in its python module called media.py but use them directly in jython, and edit using emacs.

We will also be doing lots of Linux stuff.

section 1

First, we have to change the version of Java that we use in order to use the jes media functions. This means we have to tell the Linux operating system that we want to use a version of Java that is not the default version. And, we want to set things up so Linux is notified of this when we log in. so we don't have to tell Linux "by hand" everytime we log in. We can do this by entering information in a special file. We'll do this next.

section 2

Now you are going to download and install the JES environment and edit one of its files!
JES (Jython IDE/ Jython Environment for Students) is available from: http://coweb.cc.gatech.edu/mediaComp-plan/94
Click on this link and do the following:
  1. Scroll about halfway down to the heading Source Distribution
  2. Download: JES-Source.zip
  3. Back in your terminal window type [111a-XX@localhost ~/Desktop]$ cd Desktop and type [111a-XX@localhost ~/Desktop]$ unzip *.zip
  4. Now change to the directory JES and list the files [111a-XX@localhost ~/Desktop]$ cd JES [111a-XX@localhost ~/Desktop/JES]$ ls Notice the file jes in the JES folder.
  5. Open jes with emacs and place a # sign just before the first appearance of the string: "./Sources/JESProgram.py" and save the file. The # makes the rest of the line a comment, just like it does in python. Make sure there is a space before the # sign that you insert.
  6. You, the user, need to be able to execute (run) the file, so after you exit emacs, type [111a-XX@localhost ~/Desktop/JES]$ chmod u+x jes
  7. To run jes, in Jython, type just type [111a-XX@localhost ~/Desktop/JES]$ jes You must always be in Desktop/JES to run jes.
  8. At the jython prompt type >>> print "Hello"
  9. To exit, type ctrl-d. Sometimes this must be followed by ctrl-c.
Please make sure to work together as partners. After you have installed jes on one partner's account, install it on the other, following the directions above. Do this before moving on to the next part.

Part 3

Whenever you want to run jes, do this:
[111a@localhost ~]$ cd Desktop/JES
[111a@localhost JES]$ jes
Jython 2.1 on java1.5.0_07 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>>
In other words, cd to the right directory and just type jes. and you are running Jython with jes's media library available to you!
Let's try it out using some jes functions:
You can now move on to homework3.