Python: Handy Programming(and Scripting) language
By Pratik Gajjar
Friday, 2 December 2011
Friday, 4 November 2011
Playing with python interactive shell.
Let's start with first Hello World. Go to command prompt, type python and press enter. you will see:
Now type print ("Hello World") and press enter.
You can do all other stuff with shell like you write program in any editor. After each line of code you write and press enter, you will get direct response from shell. In real world programming we generally don't use command prompt for projects. so, we will concentrate more on programming through IDE. Below is one more example for shell programming.
Download and install python.
Download:
You can download different versions of python from official python website in zip/msi/tar format. Download any format and install it. I am using Windows operating system and python version 2.7.1. you can choose your own distribution according to your environment.
After installation, set classpath to <python_root> directory so that you can run your program from anywhere.
To launch the interactive shell of python, go to command prompt, type python and press enter.(Note: if you have not set classpath then you have to go to python root directory first and then have to type python).
History of python.
Python was introduced by Guido Van Rossum in December 1989 at Centrum Wiskunde & Informatica(CWI) in the Netherlands,as a successor of ABC programming language.
At that time, it was capable for interfacing and exception handling with open source and distributed operation system Amoeba.
Python 2.0, released in 2000 was introduced with new features like garbage collector and unicode support. python 2.0 was more transparent for development and was community based.
Python 3.0, released in 2008(known as python 3000 and py3k) introduced with backward compatibility with python 2.6 and 2.7.
Python got awarded twice as TIOBE programming language(in 2007 and 2010) getting more popularity.
Thursday, 3 November 2011
The power of python.
Python is a high-level programming language. Its power or advantages are:
- It is interpreted. It allows you to run till any error occurs(if any error present in code). In other programming language(where compilation is required) you have to eliminate all errors before you run.
- Purely object oriented.
- Interactive.
- Known as glue language. Because it can be used to connect existing components from other languages(c/c++, java and many more).
- Possible to add modules to python's code vocabulary.
- Highly readable. Because it depends on indentation. Easy for beginners to understand the code.
- Easy to get support. Python community is always there to response your queries.
- Faster learning.
- Faster coding.
- Re-usability of modules and packages.
- Portability.
In short, python is a complete satisfactory programming language which combines the power of compiled languages with the simplicity and rapid development of scripting language.
Subscribe to:
Posts (Atom)