Introduction to Python

Overview

python logo

After a long time I haven’t post any blog entries,Ahhh I was too lazy and kind of busy with my studies,recently I got a chance to look in to a technically enhanced language,which is Python.It’s adoption is now drastically expanding among most of the corporate IT sectors, for example Google.Google’s new innovation,Google wave,it’s server (Pygowave) is entirely developed using Python + the Python web framework called Django.So at this point I’m going to step in to Python and briefly describe how to setup python in various platforms and will perform a small hello world example.

Special qualities of Python language
Platform independent.
Can be use as a scripting language.
Open source.
Easy to use.
Can be easily manipulated with various web freamworks.
Special interaction with the Java platform (Jython).
Moreover it’s really fun.

Lets do this (Installing Python)

So if you want Python installed on your platform and need to play with it you need a special software called Python interceptor which is bundled with the Python installer.You can get the most recent Python installation from http://www.python.org/download.
Visit there and download it.

Windows:
OK, when you visit http://www.python.org/download,you’ll see several different links in there such as Python 2.6.x and Python 3.1.x, click on a windows installer link and you’ll start the downloading process
Note:If you’re running on an AMD machine you need to select appropriate link.After downloading the installation bundle run the file by double-clicking.Follow the installation steps on the Python installation wizard don’t be afraid just select the default settings.OK now you’re done.I will continue with some code examples after explaining how to setup Python on Linux and Unix.

Linux and Unix:
Most Linux and Unix distributors included the Python interceptor.You can give it a try straight away,start the terminal/command prompt and use the command $python,by running this command will start the python interceptor and will out put the following information on to your terminal.
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

if it not you’ll get a command error
python: command not found
(Which means python is not already percent)
I’m not go in to details about how you can install Python on Linux or Unix platforms,you can get the complete guid from here

OK, assume that you have successfully installed Python on your system.Now it’s time to do some coding.Here I’m using Python interceptor on windows because currently I’m on windows,and my Python version is 2.6.

Starting the interceptor(Windows)
Programs ➤ Python 2.6 ➤ IDLE (Python GUI), you should see a window
like above, this is the Python shell inside that the Python interceptor is running.

Lets try a small code “Hello World”,
>>> print "Hello, world!"
Press enter,and the python interceptor will out puts the following.
Hello, world!
>>>

Note:You see on the screen cast I have used a semicolon “;”, but don’t worry it’s not needed it’s optional if you’re a so called Java enthusiastic person you’ll probably use a semicolon,but the Python interceptor simply doesn’t care about the semicolon.

OK,that’s it for now I’m tired.I know this is so little and you want more,Well you’ll find out more exiting things that Python can do in the near future. Keep in touch.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s