Python

Installing Python

In this course we work with Python version 3.4.
In the labs of Schreiber building, Python 3.4 is installed, and normally any 3.x version would be fine, but we strongly suggest working with 3.4.

Go to https://www.python.org/downloads/.
You will find there links to download Python 3.4.3 for various operating systems.
The installation process takes a few moments and requires just a few next clicks.

If for example you work with Windows, after you install python, you'll see in the "start menu" a folder named python 3.4, containing several links.
One of them is "IDLE (Python GUI)" - this is the recommended working environment for you this semester.
In the labs of Schreiber building (linux operating system), the menu sequence for python is applications => programming => IDLE (using python 3.4).
In the last step, do not choose the other two IDLE items (one states "2.7", and the other does not mention the option, but is also 2.7)

This YouTube video might ease the very first steps with Python: http://www.youtube.com/watch?v=kXbpB5_ywDw
It explains how to start and use Python command line and Python IDLE (as mentioned, we recommend IDLE for you).

You may also find this explanation about accessing history of previous commands in IDLE helpful: http://www.cs.tau.ac.il/courses/pyProg/1112a/recitations/add_history.pdf

Important comments:

1) Do not install any 2.x version. There are some differences between 2.x and 3.x versions which may cause you trouble when running code from class, and may result in misbehavior of the HW tests.

2) When saving .py files, make sure the file location path does not contain any folders in Hebrew. In some operating systems this prevents you from running them.

3) When you save a Python file, add the extension ".py" to its name.

Recommended Reading about Python:

1. Python 3 documentation, http://docs.python.org/py3k/, is the official language manual, and a very useful resource.
2. Think Python, by Allen B. Downey, which is available online.
3. A book by John Zelle, “Python programming: an introduction to computer science”, second edition. Fraklin, Beedle & Associates. The second edition refers to Python 3.x, which is the version used in the course.
4. the free web book Dive Into Python: http://www.diveintopython.net/

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License