Tuesday, August 4, 2015

Python program in Eclipse

INTRODUCTION

Python

  • It is interactive, interpreted and object-oriented programming.
  • It contains modules, classes, exceptions.
  • Supports dynamic data types and dynamic data binding.
  • Supports imperative, functional and procedural type of programming.

SOFTWARES & TOOLS

  1. Eclipse (Mars2)
  2. Python

GOAL

  1. Instal Python
  2. Install Python Plugin in Eclipse
  3. Create & Run a Python Program

INSTALL PYTHON

  1. Download latest python software package from official Python website: https://www.python.org/ as per your system configuration (Windows/Linux)
  2. It is advisable to install it under c: directly.

INSTALL ECLIPSE PLUG-IN

  1. In Eclipse, go to Help -> Install New Software
    1. Name: Python
    2. Location: http://pydev.org/updates
  2. Click Next & Finish
  3. Go to Window->PyDev->Interpreters->Python Interpreter
  4. Click New Button at top right
    1. Interpreter Name: Python
    2. Interpreter Executable: C:\Python27\python.exe
  5. Click OK

CREATE & RUN A PYTHON PROGRAM

  1. Create a New PyDev->PyDev Project & Enter Name for the Project.
  2. Select Interpreter (Python) which we created earlier
  3. Click Finish.
  4. Select Python Perspective by Window->Open Perspective->PyDev
  5. Select the newly created project and create an src folder (if not found) by PyDev->&Source Folder
  6. Now create a new Python program file by PyDev->PyDev &Module
  7. Enter name (helloworld) and select Template as <Empty> just for now and click OK
  8. Now your first program is ready to code.
  9. Enter below code in helloworld.py and save
print "Hello World in Python!!"
  1. Now Right click, Run As->Python Run

OUTPUT


Hello World in Python!!

No comments :

Post a Comment