The language is very easy to learn because its source code resembles pseudo code. Python is an object-oriented programming language. In Python, everything is an object, and can be handled as such. However, unlike Java, Python does not impose object-oriented programming as the main programming paradigm. It is perfectly viable for a Python project to not be object-oriented, i.e. to use no or very few class definitions, class inheritance, or any other mechanisms that are specific to object-oriented programming. In Python there is no curly braces to indentify a block of code. For example in case of an if statement all the code that is indented after the if statement belong to the if statement block.
This tutorial will go thru how to Install Python and the PyDev plugins for Eclipse. After that we will create a small "Hello world" program to demonstrate its usage.
Step 1: Download Python
You can download Python from https://www.python.org/download/. For Windows you can use the native installer python-3.2.msi for Python and follow the instructions.Step 2: Download Eclipse
Skip this step if you already have eclipse installed on your computer. Eclipse is based on Java so for you to install eclipse you need Java runtine. Most computers come pre-installed with Java and you can check if java is installed by by typing in the command java -version, otherwise go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and download Java 1.6 or higher.Step 3: Eclipse Python Plugin
PyDev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development supporting code refactoring, graphical debugging, code analysis and many other features. You can install PyDev via the Eclipse update manager using the following update site - http://pydev.org/updatesStep 4: Configure Eclipse
We have to tell eclipse about the Python location. Please open Window -> Preferences. Select Interpreter Python inside the PyDev option and click on New Configuration and add Python executable path.Step 5: Python Hello World Program
Create a Python Project named PythonBeginner. File -> New -> Project -> PyDev Project.''' Created on Oct 2, 2012 @author: betterThanZero ''' def hello(myInput): return "Hello World: " + myInput myInput = input("Please type your name: ") print(hello(myInput))Now right click on your HelloWorld module and select Run As -> Python Run
No comments:
Post a Comment
NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.