Lab exercise:
Now in the empty editor window type the following:
#! /usr/bin/python print "hi!"Click on the "Save" command in the editor toolbar, using "hello.py" as the file name, and click on the "Save" button.
Quit the editor (using File->Quit or click on the x in the upper right corner of the editor window.)
Back in your terminal window, type the following command
chmod u+x hello.py
Now type in the command
./hello.py
If successful, you should see
hi!
appear in the terminal window.
Congrats! You have just successfully written and executed your first python program for the course!
Introduction to the CS laboratory
This account is completely seperate from any other VIU computing accounts you may have.
In the first lab you will each be given your account userid and a password, along with the departmental policies on use of computer accounts.
It is important you read these policies and understand your responsibilities with respect to use of your account.
Use the userid and password provided on the account sheet given to you by the course instructor.
1. Enter your user id and hit enter
2. Enter your password and hit enter
When you are typing your password the cursor symbol
won't move in the password box, so it looks like nothing is
happening. Enter your password anyway, and hit return.
To do so, we need to open a command shell (a.k.a. command window, terminal window, etc).
To open a command window:
This will prompt you to enter your old password, then (assuming you entered your old password correctly) it will prompt you for a new password and will ask you to retype your new password to confirm it.
This will update your password on all CSCI machines.
If you have forgotten your password we'll need to contact our tech support to reset it (may take some time - don't forget your password ;-)
Introduction to linux and bash
The machines in lab connect you to a (shared) linux server named csci.viu.ca.
CSCI students and faculty can each connect to this server from a variety of locations (including connecting from home).
Each person has their own account, with its own directory (folder) of files and subdirectories.
Whenever you log in to the server you will automatically begin in your account's directory.
You have the ability to create and edit files within your account's directory, as well as create other subdirectories inside it to keep your files organized. (It can get awfully cluttered if you keep all of your files in just one big collection.)
Aside: Whenever you type in a command in a terminal window, or whenever you click/doubleclick on items in the visual interface, your commands get interpretted by a command shell. The particular command interpretter being used on csci is called bash. |