From fmm281@nyu.edu  Sun Sep 16 15:49:56 2012
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.49.96])
	by mail.cims.nyu.edu (8.14.5+Sun/8.14.5) with ESMTP id q8GJntMh019673
	for <shasha@mail.cims.nyu.edu>; Sun, 16 Sep 2012 15:49:55 -0400 (EDT)
Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177])
	by mx2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id q8GJnms8021272
	for <shasha@cs.nyu.edu>; Sun, 16 Sep 2012 15:49:48 -0400 (EDT)
Received: by obbta17 with SMTP id ta17so8636501obb.36
        for <shasha@cs.nyu.edu>; Sun, 16 Sep 2012 12:49:42 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type
         :x-gm-message-state;
        bh=pzdpQBeoqhR+uNqbzaN5qtWRI8/4dJNrF5wgZzDc35w=;
        b=SYO6BbIFjAJ3VnKM27WGq0DW9jgyiAhQ8SaM44xGkgCXJW89IRd9UCUqcX+V+dvegG
         tsH52JEyhWF9KVqTUxIdiAul64pVHkZVG3IBnmil/YbnTuvMfwo2owoNaFBQeGiYa3mJ
         saFuAvngLK3iP9jDsDKWc3hYFHeziRG/vhATDLxk8vxtjFRBbAWUrPU5u/9I/hX7zek9
         Vaf/5Q5Du+yHFEHVVfv0zolDhjR/o7E4Pvzsaha/vZO1ThOMlRSuo89WeodCx0DwGRhR
         sYaTLh72s15RzoVtn5n0drPhJlGJCJlpgdAtgdzpWldbzw5YjP5w3JdB6bumMDU3CN6e
         NAHQ==
MIME-Version: 1.0
Received: by 10.182.1.72 with SMTP id 8mr9669134obk.61.1347824982724; Sun, 16
 Sep 2012 12:49:42 -0700 (PDT)
Received: by 10.76.124.71 with HTTP; Sun, 16 Sep 2012 12:49:42 -0700 (PDT)
Date: Sun, 16 Sep 2012 15:49:42 -0400
Message-ID: <CAP+bPiNWWzrY48O8wyu72kavXUx6KQgeBi17pzBNGYOT7B0bSg@mail.gmail.com>
Subject: Setting PATH Variables in Windows - Computational Thought
From: Felix McCormack Moody <fmm281@nyu.edu>
To: aa3225@nyu.edu, adc411@nyu.edu, al3213@nyu.edu, cl2488@nyu.edu,
        drk289@nyu.edu, esh322@nyu.edu, jib271@nyu.edu, jjk500@nyu.edu,
        lz803@nyu.edu, nw683@nyu.edu, rkp260@nyu.edu, sak548@nyu.edu,
        sh2937@nyu.edu, shasha@cs.nyu.edu, ss6620@nyu.edu, zw517@nyu.edu,
        zz589@nyu.edu, shasha@courant.nyu.edu
Content-Type: multipart/alternative; boundary=f46d04462fe050929604c9d6f525
X-Gm-Message-State: ALoCoQl6Jzj0J1y0fxIgY9Ry5mzvrxzx9JNp7cvE1J4TmN124XaSySbMAcfu9CtR3T1NLG+48oqt
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (mx2.cims.nyu.edu [128.122.49.96]); Sun, 16 Sep 2012 15:49:48 -0400 (EDT)
X-Scanned-By: MIMEDefang 2.73 on 128.122.49.96
Status: R
Content-Length: 5744

--f46d04462fe050929604c9d6f525
Content-Type: text/plain; charset=ISO-8859-1

Hey guys,

Here's how I set up python to work on Windows 7 - a lot of this applies to
windows xp as well.
(Note: whenever you need to type something i'll enclose it in quotes. Just
type what's inside the quotes, not the quotes themselves)

After you've run the python installation, you need to change your "path
variables" to allow you to run python scripts from any folder using command
prompt and run python in "interactive mode." This requires a bit of an
explanation. You guys probably know what the command prompt is, but if you
don't, it's a very basic form of windows that is text only
and receives input from a keyboard and outputs line by line. It used to be
that the command line was the only way to communicate with a computer. Back
then it was called DOS, and it was the operating system, analogous to
windows today (DOS stands for disk operating system). In the
90's Microsoft came along with a DOS program which allowed for mouse input
and displayed information in windows, similar to how today's computers
output. The later versions of that program were Windows 95, Windows 97,
Windows 2000, etc. Eventually, Microsoft designed windows from the ground
up independent of DOS, but you can still access an emulated DOS window, the
command prompt, also known as MS-DOS (Microsoft dos).

A lot of things you might need to do in windows can also be done from
within the command prompt. To open the command prompt, click Start and
search "cmd" in the box directly above. Select "cmd.exe" from the search
results and a black window should pop up. After some legal stuff you should
see something like "C:\Users\Felix>" on the bottom line. That is the
"working folder" that the command prompt is operating in. "C:" is the hard
drive, with folders nesting (getting smaller, more specific) moving left to
right and separated by "\" (backslashes, different from the slashes in a
URL). You can open a file in the working folder by typing the files name in
quotes, like "Photo.jpg". To change the working folder to say,
"C:\Users\Felix\Desktop" (the folder for the desktop, change my name to
your windows username), type "cd C:\Users\Felix\Desktop". You can also type
"cd.." to go one folder up, and to select and enter folders in the working
folder (eg go a level down) type "cd examplefolder". Try googling "MS-DOS
basic commands" and messing around with some of them.

Remember when I said you need to change your "path variables"? Path
variables are just folders where the command prompt looks to find programs
to run the files you select. For example, if you select an mp3 file,
command prompt might open itunes if you put the location of the itunes
program file in the list of path variables. We want to be able to run
python programs (filename.py), so we have to enter python's location in the
list of path variables. To do this, Click start, right click on Computer
(right column) and select properties. In the window that opens up, click
"Advanced System Settings" in the left column. In the Advanced tab of the
window that opens up, click "Environmental Variables" (very bottom). In the
window that opens up, select the line with "path" in the bottom section
(system variables) and click edit below. We're going to add some text to
the bottom box, but make sure not to delete what was already there! It's
basically a list of folders separated by semicolons. If there isn't a
semicolon at the end of the text in the bottom box, add one, then add
"C:\Python27;"
(Without the quotes). I'm assuming you didn't change where python was
installed during installation. If you did, change the path to where you
installed python. Hit okay on all the open windows. Now if you navigate to
where a python file is using cd in command prompt and select it (type it's
name and hit enter), python will open and process it. Python doesn't
actually have a window, so all you'll see is the output of the program in
the command prompt window. Try doing that with hello.py from Professor
Shasha's email.

Setting the path variables also allows you to run python in interactive
mode. Interactive mode lets you test out expressions line by line. To enter
interactive mode, just type "python" in the command prompt. The bottom line
should now be ">>>". Try typing "print "Hello world!"". Try typing "x=4+8",
then "print x". Oh, and capitalization matters!

A few other things:

It might make your life easier to set windows to always show
file extensions (.txt, .doc, .mp3, .jpg, .py, etc). By default windows
hides extensions for which there is a program associated with it. Even
though you can usually tell the file extension by the icon, it may happen
where you can't tell if a file has a .py extension or .txt extension, for
example. If you try to run a perfectly written python program with a .txt
extension, the command prompt will just open it with notepad. To set
windows to always show file extensions, open Windows explorer (the thing
you use to view files, not internet explorer), and click "Organize" in the
top bar on the left. Select "Folder and Search Options" and then the view
tab in the window that opens up. Uncheck "Hide file extensions for known
file types" and hit okay.

Windows might not let you do certain things with the command prompt unless
you run it in administrative mode. If windows tells you that "You don't
have permission to do that" etc, try right clicking on the icon for cmd.exe
and selecting "Run as Administrator."


I think that's about it. I hope this explanation was complete enough for
everyone to understand, but if you're having some trouble feel free to
email me or shoot me a text (518-210-6507) and maybe we can talk it out.

~Felix

