cs17700:fall15:workfromhome

Although the CS department has a number of labs available for working on Python prelabs and projects (such as HAAS G056 and LWSN B160), sometimes these labs are occupied, or some other circumstances keep you from being able to make it to the computer labs to get your work done. It is actually very easy to set up your Windows or Mac machine at home to do everything needed to work on prelabs and projects(unfortunately, you still have to go to your labs for actual lab assignments!)

After this tutorial, you will be able to do the following on your Windows or Mac machine:

  • Install and use Python;
  • Transfer files between your machine and data.cs.purdue.edu; and
  • Access the UNIX system on data.cs.purdue.edu to turnin your files.

A downloadable version of Python is available here. Note the version of Python we are using is 3.4.2, and the version available for download here is newer - however, this should not cause you any difficulties for anything we do in the course.

To check whether you have 32- or 64-bit Windows installed (assuming you're using Windows 7), click on the Start button, then right click on My Computer and select Properties. You should see a window which says “View basic information about your computer”. Under the System heading, you should see a System type: row, which will tell you whether your version of Windows 7 is 32- or 64-bit.

For Macs, check your version of OS X by clicking on the blue apple icon in the upper left corner of the screen, then choose About This Mac. You will be given a version number on the following window. Download the appropriate version of Python based on your version of OS X.

Open the installer file that you have downloaded and follow the on-screen directions to install Python on your system.

Once Python is installed, you may run IDLE to write and run Python programs, like we did in class.

To transfer your files from your computer to the network drive on data.cs.purdue.edu, we will use a program called an FTP client - this uses FTP (the File Transfer Protocol) to send files between computers. The FTP client we will be using is called FileZilla, which you can download here.

Again, run the installer once it has downloaded and follow the on-screen instructions to install FileZilla. The installer may offer to install other programs in a bundle with FileZilla - you do not need these programs and should not install them.

Once it has installed, run FileZilla and you will see a screen that looks like the one below.

Enter the following information for the fields at the top:

  • Host: data.cs.purdue.edu
  • Username: Your Purdue login name
  • Password: Your Purdue password
  • Port: 22

Once you have entered this information, hit Quickconnect.

If you have entered your information successfully, the right half of FileZilla should now display the contents of your home directory on data.cs.purdue.edu. Find where you have saved your files on your computer by navigating the folders on the left side, then drag and drop them into the appropriate directory on the right side to copy your files to that directory on data.cs.purdue.edu.

If you are using a Mac, access a Terminal window (under Applications → Utilities). We will be using a UNIX program called ssh (secure shell) to remotely connect to the UNIX machine, just like we used PuTTY on the Windows machines to do so.

Once you are at your Terminal prompt, enter the following command (if this example doesn't make sense to you, please read the UNIX tutorial):

$ ssh your_purdue_login@data.cs.purdue.edu

Replace your_purdue_login with your actual Purdue login. You may have a prompt which asks you something along the lines of:

The authenticity of the host 'data.cs.purdue.edu' cannot be established.
RSA key fingerprint is ... (some set of letters and numbers)
Are you sure you wish to continue connecting? (yes/no):

If so, type 'yes'. The program should prompt you for your password; once you enter it, you will be remotely connected to the UNIX machine.

If you are using Windows, download PuTTY here.

You can then set it up the same way we did in class, by entering data.cs.purdue.edu for the host name and then entering your username and password when prompted.

If you get a window that looks like the above when connecting to the server, just press Yes.

After following the steps presented above, you have everything set up to work on your Python homework and projects from home. Simply write and test your programs using Python/IDLE, copy them over to the server using FileZilla, and turn them in using Terminal/PuTTY.

Although unfortunately you cannot work on your lab assignments this way, hopefully this approach is more convenient for working on prelabs and projects!

  • cs17700/fall15/workfromhome.txt
  • Last modified: 2015/06/01 02:09
  • by msehgal