Introduction to Computer Science
CompSci 101 : Spring 2014

Installing and Getting to know Eclipse

In order to write programs, you will need some other programs. These allow you to edit your program, translate it into a simpler representation that your computer can understand, and run it. These initial steps may seem a little overwhelming, but they only need to be done once to get things started and working together.

Try to get Java, Eclipse, and Python installed before lab using these installation instructions. Downloading the software beforehand will minimize network congestion during lab. If you have not succeeded in getting the software working the UTAs will try to help you with that during lab.

Exercise 1 : Create a Workspace

Start Eclipse and create a workspace for all your programs in this course (like compsci101). You can put your workspace anywhere, but you will need to remember where it is later in the semester so putting it in a simple, easy to get place is a good idea (such as your Documents folder). Note, unlike typical programs, Eclipse asks you once, at the start, where to save your work rather than each time you work on a file.

Exercise 2 : Create a Project and Write Some Code

Create a new Python project named "Lyrics" by choosing File -> New -> PyDev Project and typing that name into the "Project name" field of the Project Wizard that appears (you do not need to change any of the other settings in the dialog box).

Create a new Python module name "MyFavoriteSong" within your project by right clicking on the project in the list on the left side of Eclipse, choosing New -> PyDev Module, and typing that name into the "Name" field of the Module Wizard that appears (you do not to include a value for the "Package" field). Choose the "empty" template (the default) from the Template dialog box that appears next.

Copy the lines of code below into your new module and modify them to print a line from one of your favorite songs instead:

def printLyrics ():
    print("CompSci 101 is my favorite course")

Exercise 3 : Understanding Eclipse

Find the actual file associated with your Python module on your hard drive.