myFile distanceHome carSpeed boatSpeed airSpeedYou store a value in a variable by using acommand called an assignment statement. The syntax of an assignment statement is to
>>> radius = 5 >>> circumference = pi * 2 * radius >>> area = pi * radius * radius >>> print circumference 31.41592653589793 >>> print area 78.53981633974483 >>> |
Another good command to know is showVars(). This command will open a window that will list all of the known variables, the values of the variables and the types of the variables. We will discuss types later. Try typing in the above commands into JES.
This command does not input/argument value. It allows the user to change directories and select a file. The selected file will be returned and could be stored in a variable or used as input for another command.
This command will allow JES to use/manipulate a JPEG image. The input to the command is the name of a file (usually retreived via the pickAFile() command). The result of the command is usually stored in a variable so the image can be accessed by other JES commands.
This command will have JES open a window and display the file given as the input to this command. Usually the input is a variable that was created by the makePicture() command.
The result from the pickAFile() command should be saved in a variable. This variable will be used as the input for the makePicture() command.
The result from the makePicture() command should be saved in a variable. This variable will be used as the input for the show() command.
This function is to be saved to a file and load so it can be executed in the command area of JES.
On the ACCC lab computers, the H: drive is a permanent storage area for you. Saving files to this drive on one computer can be accessed from another computer (even another computer in a different lab). It is suggested that you save your python programs to the H: drive.
You are to submit your lab program using turnin on the icarus machine using the project name of lab9. You will need to transfer your program to the icarus machine so you can turn it in. You can do this by mailing it to your icarus account or by using the file transfer window in SSH. To submit the file in <filename>.py for lab9, the turnin command is entered as:
turnin -c troy -p lab9 <filename>.py