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
- From the main menu bar select Applications
> Accessories > Komodo. (This
may take a few seconds to launch; be
patient.)
- Press Ctrl-N to obtain a new window for
entering text.
- 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.
- Write your program, saving just before you
compile and run it. (Save frequently
for longer programs.)
- When you go back to make changes after
running your program, don't forget to save
again so the changes take effect.
- 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".
- Click the "Browse other folders" option if
necessary to navigate to your program folder
on the csfile2 server.
Compile and run a Python program
- If it is not already open, from the main
menu bar select Applications >
Accessories > Terminal.
- Type ls
at the prompt to see a list of all files and
folders in your directory.
- 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.
- Repeat the previous two steps as necessary
until you are within the subfolder
containing your program file.
- 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.
- Type exit
to leave the Terminal.
Work within a Python shell
- If it is not already open, from the main
menu bar select Applications >
Accessories > Terminal.
- 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.
- Type exit()
to quit the Python shell, then type exit
to leave the Terminal.
Modify an existing Python program
- From the main menu bar select Applications
> Accessories > Komodo.
- 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.
- 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.
- 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.
- Continue as described in the first set of
instructions above.
Access a file on your P drive or the
T drive
- If it is not already open, from the main
menu bar select Applications >
Accessories > Terminal.
- Type mountp
(or mountt)
at the terminal prompt, then type your
account password.
- From the main menu bar select Places >
Home Folder.
- 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.
- 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
- 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.)
- Your csfile2 folder should now be
available.
Access the csfile2 server remotely
from a Mac
- From the Finder select Go > Connect to
Server... from the menu bar.
- In the text field in the next window type
smb://csfile2
- 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.)
- Your csfile2 folder should now be
available.
|
|