Using Python
We have seen in class that there several ways we can run Python code:
- Typing into an "activecode" window in the textbook
- Using the Python interactive shell
- Creating a Python program (script) using a text editor and running it
Wing 101
- Right-click on the start button at the lower left corner of the desktop, and select "Search".
- Type "wing" into the search box. It should locate the program Wing 101. Click on the resulting shortcut if it doesn't automatically start.
- Accept the license agreement.
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:- Go to the Edit menu and select Configure Python...
- In the Python Configuration dialog, under "Python Executable", select "Custom"
- Click the Browse button and go to This PC, then "OSDisk(C:), then Python34, and select the file named
python3
- Click Open
- In the Python Configuration dialog, click OK
- When it asks you whether to restart the shell, click Restart
(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: