Difference between revisions of "CSC111 Lab 3"

From dftwiki3
Jump to: navigation, search
(Creating and running programs)
(Creating and running programs)
Line 45: Line 45:
  
 
<source lang="python">
 
<source lang="python">
 
+
 
+
def main():
+
def main():
  name = raw_input( "what is your name? " )
+
    name = raw_input( "what is your name? " )
  print "hello there, " + name + "!"
+
    print "hello there, " + name + "!"
 
+
&nbsp;
+
 
</source>
 
</source>
  

Revision as of 14:55, 8 February 2010

Software Setup

Before you can use the JES programming environment, you need to install it first.

  • Login to your Novell account.
  • Open your H: drive in Windows Explorer.
  • Open Windows Explorer a second time, so that you have two windows open.
  • In the second window, enter this address in the Address bar: \\rescent\pc\COURSES\CSC\CSC111
This is the place on the Novell network where you will find many files related to the homework assignments and the labs.
  • Drag the folder named jes-3-1-1windows from the CSC111 window to your H: drive.
    JESicon.png
  • Close the windows showing the CSC111 folder
  • In the window showing your H: drive, open the JES folder and click on the JES icon (snake face with glasses :-)
  • After a few (long) seconds, you should get the JES programming environment.




JESidePC.png


If you want to install JES on your personal computer

If you want to install JES on your Mac or Windows laptop or computer, you can get also get JES from the Web, at this address http://coweb.cc.gatech.edu/mediaComp-teach/26. Click on the the file jes-3-1-1-windows.zip if you use Windows, or on jes-3-1-1-macosx.dmg if you have a Mac, and install as you would a regular application.

Notes for Mac users

Jes for the Mac is available on Google code. Get Jes 3.2.1 for the Mac and install on your mac.


Lab Exercises

Open JES by double-clicking on the icon or navigating through the start menu (on pcs)

  • In the window that opens, the top portion is program area, and the bottom portion is command area (the interactive window we have already seen on beowulf).

Creating and running programs

In the Program area, type in the following lines, being careful to follow the format exactly (including all punctuation and indenting)

 
 
 def main():
    name = raw_input( "what is your name? " )
    print "hello there, " + name + "!"
  • Save the file by typing Control-S.
  • A popup window opens up. Save the file as hello.py in your H: drive
  • Click on Load Program button to load the file just stored in JES.
  • In the command area (black window), type
  main()
to call the function.
  • Make sure you see the pop-up window asking for your name, and the response of the program in the interactive area.