Python IDE – How to set up Python editor to start writing programs

Downloading Python from official website

In order to be able to learn and run Python programs at your computer you need to download stable version of Python and configure it (if required). The current stable versions are Python 2.7.6 and Python 3.3.3.

For learning purpose we recommend downloading latest version. However if you need to learn and then work at a previously developed project then maybe you need previous version.

The downloadable versions are available at following link: http://www.python.org/download/

Installing Python at Windows computer

Follow these steps to install Python:

  • Download appropriate version from link given above for Windows. The windows installer is Pythonxx.msi.
  • After downloading double click on .msi file and run the setup.
  • Just follow the steps.

Running code on Shell window

Lets us say, If you are using Windows 7 and installed Python 3.3.2 then go to Start –> All Programs –> Python 3.3 and open IDLE(Python 3.3)

After shell window is opened (IDLE) write these statements:

That should output as:

Hello world

Here you go, Python is installed.

Please note print has become function in Python 3.3. Before that it was  taken as statement. So this will generate an error:

Print “hello world”

There you may write any commands, statements, loops etc using Python syntax.

Similarly you can use menu File – New Window in shell window: This will open a new window where you can write full code of Python. Save it to desired location and give it a name. To parse/run code press F5 or go through menu.

Setting up Python on MAC OS

In MAC OS Python is bundled, i.e. Mac OS already has it. However this is quite probable that the version is quite old. In order to use latest version go to download page of official website: http://www.python.org/download/. Download appropriate version for MAC and install it into your system.

How to start IDLE on MAC

In a terminal window, type python. The Python shell should be started.

In prompt (>>>) of shell window type: import idlelib.idle

This should start Python’s IDLE IDE.