Using Python

We have seen in class that there several ways we can run Python code:

Although Python programs are just text files and can be created with any text editor, we usually want to use an integrated development environment (IDE) in which we can easily edit, run, and debug our code. For the labs in this course we will use an IDE called Wing 101. You'll find it is better, and easier to use, than the IDE that is built in to the Python installation (called IDLE) and is free if you want to install it on your own computer.

Wing 101

  1. Right-click on the start button at the lower left corner of the desktop, and select "Search".
  2. Type "wing" into the search box. It should locate the program Wing 101. Click on the resulting shortcut if it doesn't automatically start.
  3. Accept the license agreement.
You should see something like this:

(Screenshot of Wing 101)

Configuring Wing to use Python 3

Recall that there are some incompatibilities between Python 3.4, which we are using for this course, and Python 2.7. The lab machines have both versions and by default, Wing will try to use 2.7. So before you do anything else:
  1. Go to the Edit menu and select Configure Python...
  2. In the Python Configuration dialog, under "Python Executable", select "Custom"
  3. Click the Browse button and go to This PC, then "OSDisk(C:), then Python34, and select the file named python3
  4. Click Open
  5. In the Python Configuration dialog, click OK
  6. When it asks you whether to restart the shell, click Restart
(Screenshot of Python Configuration dialog)

(You should only have to perform these steps the first time you use Wing in the lab.)

Now, look at the Python shell tab at the bottom right. It should start with "3.4.1" as in the screenshot above.

Try out the shell

Try typing a Python expression or statement at the prompt ">>>", like this:

(Screenshot of Python shell)