

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS 110: Introduction to Computer Science Spring 2008
Introductory Tutorial JES is a development environment for Python that allows you to write Python programs which can do photoshop like manipulations of images. JES can be accessed from your CS account. Your instructor will let you know how. Loading JES might take a few seconds. After it comes up, Click on Help | Table of Contents. This will get you to some information and tutorials on how to create images, sound, and movies with JES. For now, just follow the instructions below. JES has two main windows. The top one is a text editor in which you can create python programs in files with .py extensions. The bottom one is a python interactive interpreter. After creating or opening a python file in the top window, you can click 'Load' and it the program will be executed in the interpreter (bottom window). JES provides some library methods of its own that are not part of the standard Python library. One is pickAFile() which pops up a file choosing dialog. In the interactive interpreter, enter the following:
fileName= pickAFile() When the file chooser appears, choose some file (for now it doesn’t matter which one). print fileName This should print out the full path of whatever file you chose. Now let's view a picture.
CS 110: Introduction to Computer Science Spring 2008
filename= pickAFile()
pic = makePicture(filename)
show(pic) The image should appear in a window.
addLine(pic,0,0,500,500) repaint(pic) Do you see the line on the picture?
addText(pic,100,100,'HELLO')
writePictureTo(pic,filename) After doing this, go into the folder where the pic is and double- click it. Whatever application opens it should show it with the line. Good Job! Next, we'll learn how to manipulate images pixel by pixel.