How do I move a file from one computer to another?

The typical problem is that you are running Python on a server (say, geoflop.uchicago.edu), and you have saved a graphics file or perhaps a Python script or data output file there. Then for further work, e.g. incorporation into a lab report or problem set write-up, you need to move the file to your own computer, or whichever computer you are running your word processor on. There are several ways to do this.

Method 1: I'll assume the server is running a Linux-like operating system. That includes Mac OSX machines, which work just fine as servers for the courseware. The basic command-line utility for moving files around in Linux-like operating systems is scp ("Secure Copy"), which has pretty much replaced ftp. Let's suppose that your userid on geoflop is bilbo, and that you have a file on geoflop called NicePlot.eps, located in a subdirectory called work. Suppose you want to transfer it to a directory ("folder") called Documents, located in the home directory of your own workstation. For the moment, I'll assume your workstation is a Linux machine or OSX Mac (practically the same thing). Here are the steps you need to take:

  1. Get a terminal window (any kind) on your workstation. By default you will come up in your home directory, but if you've been moving around some you can just type cd at the command prompt to go back to your home directory.
  2. Move to the directory you want to put your file in, by typing cd Documents.
  3. Now type scp bilbo@geoflop.uchicago.edu:work/NicePlot.eps NicePlot.eps . You'll get a password prompt, to which you respond with your geoflop password. Note that you don't really need to specify the local name under which you are saving the file. You can save typing by replacing the local name with a period (.), which will save the file into the current directory with the same name as it has on the server.
  4. The transfer will take place, and that's it! Note that if you have multiple files to transfer, you can use wildcard notation to do them all at once. For example: scp bilbo@geoflop.uchicago,edu:*.pdf . will transfer all files in your home directory with the ".pdf" extension. Caution: the period at the end of that command is part of the command.

scp (and ssh) are also available for Microsoft Windows machines, but since they are not a standard part of the operating system, you will have to ask around or look around your machine to see what name they're installed under. There are many different versions. A very common version of ssh and scp on Windows is PuTTY and pscp. The former is a clickable terminal application, and the latter is a command-line utility. WinSCP is also pretty common. These are freeware, and can be very easily installed yourself if you have the right permissions for your workstation.

Method 2: If the server on which you are running Python is running a properly configured web server (as is geoflop), then you can create your own web site by simply putting files in the directory public_html in your home directory, (On some systems the web directory is called www instead; ask your friendly local sysadmin). If the directory doesn't exist already, go to your home directory and type mkdir public_html to create it. Now, suppose you have created some pdf and gif graphics files. From the directory they're located in, you can just type cp file1.pdf ~/public_html,cp file2.gif ~/public_html and so forth, to copy them to your web directory. Then, if your userid on geoflop is, say, bilbo, you can point any browser on any machine to the URL http://geoflop.uchicago.edu/~bilbo and you'll see a list of your files. When you click on a name, either the image will appear in the browser (whereafter you can save it), or the file will be downloaded to your local disk, depending on how your browser is configured. If you know a little html, or can use a simple web page editor application, you can get a little fancier and organize your files more nicely by building a web page with explanatory notes and links to the images.

In fact, if you are somewhat web-literate, building a little web site is a very nice way to present your results, and saves paper and time printing besides (to say nothing of the fact that it's very hard for your instructor to lose a web site, but rather easy to lose a piece of paper). Getting complex equations onto a web page is tricky, however, so if you're turning in something with a lot of derivations, it is best to stick with LaTeX or an industrial-strength word processor for that part of your write-up, referring to figures on your web page where needed.

Method 3: Some servers (though not geoflop, at present) are set up in such a way that your server home directory can be mounted as a remote disk on your local workstation. All Linux/OSX servers can be set up to make home directories available this way, but the sysadmin of the server has to grant sufficient permissions, which sometimes raises security issues. If the server home directory is made available for mounting over the network, you can do the mount on an OSX workstation from the Connect to Server option in the go menu of the Finder. The server name to use will typically be something like nfs://geoflop,uchicago.edu, but it might be simpler if the server itself is a Mac. Your sysadmin will be able to tell you what server name to use. If your workstation is a Linux machine, you can mount the remote directory using the mount command with the appropriate file system name. You will need sufficient permissions on the local machine to do a mount, though. If your sysadmin has been clever enough to allow the server volumes to be mounted on Microsoft Windows Machines, he or she will also be clever enough to tell you how to do the mount.

Once you have your server home directory mounted on the local desktop, you can move files around by drag-and-drop as usual.