Anonymous user
Python on Windows: Difference between revisions
no edit summary
imported>Paulproteus |
imported>Jesstess No edit summary |
||
(26 intermediate revisions by 6 users not shown) | |||
Line 1:
== Download and install Python ==
If you believe you already have Python installed, please let a staff member know before completing these steps.
<ol>
<li>
<li><b>Open a command prompt (we will be doing this multiple times, so make a note of how to do this!)</b>:
<li>Test your Python install by typing▼
* On Windows XP: click on the Start menu (the Windows logo in the lower left of the screen), click on "Run...", type <code>cmd</code> into the text box, and hit enter.
<br />
You now have what's called a command prompt. This command prompt is another way of navigating your computer and running programs -- just textually instead of graphically. We are going to be running Python and Python scripts from this command prompt.
</li>
<pre>
Line 14 ⟶ 23:
>>>
</pre>
You just started Python! The <code>>>></code> indicates that you are at a new type of prompt -- a Python prompt. The command prompt let's you navigate your computer and run programs, and the Python prompt lets you write and run Python code interactively.
</li>
<li>To exit the Python prompt, type
<pre>
</pre>
and press Enter. This will take you back to the Windows command prompt (the <code>C:\</code> you saw earlier).</li>
</ol>
==
You might have noticed that you typed a
=== Get to System Properties ===
▲You might have noticed that you typed a directory name above when launching Python. In this step, you will reconfigure your computer to put Python on the system PATH so that you can run it without typing the ''Python27'' directory name.
# Open up "My Computer" by clicking on the Start menu or the Windows logo in the lower-left hand corner, and navigate to "My Computer" (for Windows XP) or "Computer" (For Vista and Windows 7).
# ''Right-click'' on the empty space in the window, and choose ''Properties''.▼
==== If you're using XP ====
A window labeled "System Properties" will pop up.
# Click the "Advanced" tab.
▲# ''Right-click'' on the empty space in the window, and choose ''Properties'
#* A window labeled "View basic information about your computer" should appear▼
==== If you're not using XP ====
# In the new window, click "Advanced system settings"▼
#* A window should appear whose title is "System Properties"▼
#* Make sure you are in the tab labeled "Advanced"▼
# Click the button labeled "Environment Variables". A window labeled "Environment Variables" should appear.▼
=== Edit the Path ===
▲# Click the button labeled "Environment Variables"
#* A window labeled "Environment Variables" will appear.
# In this window, the screen is split between "User variables" and "System variables". Within "System variables", scroll down and find the one labeled '''Path'''. Click the "Edit..." button.
#* A window with the "Variable name" and the "Variable value" should appear. The "Variable value" will already have some text in it; click in the box to unhighlight it (we don't want to accidentally delete that text).
# In the "Variable value" box, scroll to the end. Add
# Hit "OK" to close out the system properties changes.
# Test
## Open up a <b>new</b> command prompt: you do this the same way you did above when installing python. This needs to be a new command prompt because the changes you just made didn't take affect in prompts that were already open.
#
#
## Exit the Python prompt by typing <pre>exit()</pre> and hitting enter. Now you're back at the Windows command prompt (<code>C:\</code>).
== Success! ==
You have Python installed and configured.
[[Boston Python workshop 2/Friday setup|« Back to the Friday setup page]]
|