Department of Mathematics, Computer Science, and
                Statistics
St.
                Lawrence University
Zonohedron
 

What is this object?

...

Links
Overview
Schedule
Grading Info
Class Notes

 

CS 140: Introduction to Computer Programming


Using the Linux Machines and the csfile2 server

The instructions below assume that you have logged into one of the terminals in a computer classroom on the first floor of Bewkes Hall.  If you are working on your own machine you will need to figure out how to modify these steps.  (See below for how to access the csfile2 server remotely.)  Be aware that there are often several ways to accomplish a given task on a computer; these instructions indicate one approach.

Create a new Python program
  1. From the main menu bar select Applications > Accessories > Komodo.  (This may take a few seconds to launch; be patient.)
  2. Press Ctrl-N to obtain a new window for entering text.
  3. Click on the small pair of up/down solid triangles in the bottom right corner and select "Python" (but not "Python 3") from the menu list.
  4. Write your program, saving just before you compile and run it.  (Save frequently for longer programs.)
  5. When you go back to make changes after running your program, don't forget to save again so the changes take effect.
  6. Press Ctrl-S to save.  The first time you will need to type a name for your program in the appropriate text field.  (Otherwise it will be given a generic name like "txt-1.txt".)  Use the extension .py for all Python programs, as in "ballbounce.py". 
  7. Click the "Browse other folders" option if necessary to navigate to your program folder on the csfile2 server.

Compile and run a Python program

  1. If it is not already open, from the main menu bar select Applications > Accessories > Terminal.
  2. Type ls at the prompt to see a list of all files and folders in your directory.
  3. Type cd CS140 to open the folder called "CS140", for instance.  TIP: for long file names, just type the first few letters, then hit the TAB key.  Unix will automatically fill in the rest of the file name for you.
  4. Repeat the previous two steps as necessary until you are within the subfolder containing your program file.
  5. Type python ballbounce.py to run the ballbounce.py program, for instance.  The same tip as above about the TAB key works here as well.
  6. Type exit to leave the Terminal.

Work within a Python shell

  1. If it is not already open, from the main menu bar select Applications > Accessories > Terminal.
  2. Type python to launch Python.  You will be given a command line prompt >>> from which you can execute basic Python commands without going through the whole programming process.  This is a great way to become familiar with Python commands, data types, and so forth.
  3. Type exit() to quit the Python shell, then type exit to leave the Terminal.

Modify an existing Python program

  1. From the main menu bar select Applications > Accessories > Komodo.
  2. The Komodo text editor keeps track of your recent projects, so you may be able to simply click on the program you wish to modify from the list in the window.
  3. If your program does not appear, press Ctrl-O to get an open file dialogue box, then navigate to the file you wish to open from there.
  4. Be sure to use the Save As command to give the file a new name if you want to keep a copy of the original program.
  5. Continue as described in the first set of instructions above.

Access a file on your P drive or the T drive

  1. If it is not already open, from the main menu bar select Applications > Accessories > Terminal.
  2. Type mountp (or mountt) at the terminal prompt, then type your account password.
  3. From the main menu bar select Places > Home Folder.
  4. In the window that opens, double click the folder labeled p (or t).  You can now navigate to the desired file within the P or T drive.
  5. By also double-clicking on the csfile2 server icon on your desktop, you can simultaneously open your CS140 folder located there.  You can now drag and drop files back and forth between these two folders.

Access the csfile2 server remotely from a PC

  1. Go to the "My Computer" window and type \\csfile2\username in the address bar.  (Replace username with your actual username.  Thus I would type \\csfile2\svanderv to connect.)
  2. Your csfile2 folder should now be available.

Access the csfile2 server remotely from a Mac

  1. From the Finder select Go > Connect to Server... from the menu bar.
  2. In the text field in the next window type smb://csfile2
  3. You should be given an option of drives to mount.  Select the option that is your username.  (So I would choose svanderv from the list.)
  4. Your csfile2 folder should now be available.