Friday, 20 May 2011

Python - Basic concepts

As the part of the learning  python I started to  read a text about the python programming language – “Think Python by allen B. Downey”. The goal of this book is to teach us to think like a computer scientist.  I think this book is very useful for all the beginners to understand the concept of python, because during this book using simple language to explain everything about the python. Everyone can easily realize and also lead to a quick improvement in learning. Here I want to share my learning experiences regarding the python.
We already familiar with some of the high-level programming languages such as C, C++, Perl and Java. Python is also a High-level programming language. High-level language programs are easy to written and it is also portable, so almost all programs are written in High-level languages. Interpreters and compilers are used to process high-level languages into low-level languages.

An interpreter reads a high-level program and executes it.
A compiler reads the program and translates it completely before the program starts running.
Python is an interpreted language because python programs are executed by an interpreter. There are two ways to use the interpreter: interactive mode and script mode.
Interactive mode : In this mode we type Python programs and the interpreter prints the result:
>>> 1 + 1
The chevron, >>>, is the prompt the interpreter uses to indicate that it is ready. If you type 1 + 1, the interpreter replies 2. Interactive mode is convenient for testing small pieces of code. In the case of more lines of code, we must need to save our code as a script so we can modify and execute it in the future.
script mode : In this mode store code in a file and use the interpreter to execute the contents of the file which is called a script. By convention, Python scripts have names that end with .py.

What is a program?
A program is a sequence of instructions that specifies how to perform a computation. The details look different in different languages, but some basic instructions appear in just about every language, they are input, output, math, conditional execution and repetition.
We can think of programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with one of these basic instructions.
What is Debugging?
Programming errors are called bugs and the process of tracking them down is called debugging. Three kinds of errors can occur in a program: syntax errors, runtime errors, and semantic errors.
Syntax error
Python can only execute a program if the syntax is correct; otherwise, the interpreter displays an error message. For example, parentheses have to come in matching pairs, so (1 + 2) is legal, but 8) is a syntax error.
Runtime errors
Here the error does not appear until after the program has started running. These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened.
Semantic errors
If there is a semantic error in our program, it will run successfully in the sense that the computer will not generate any error messages, but it will not do the right thing. It will do something else.

Python - History

Python was conceived in the late 1980 and its implementation was started in December 1989  by Guido van Rossum. Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, Benevolent Dictator for Life (BDFL).

Python 2.0 was released on 16 October 2000, with many major new features including a full garbage collector and support for Unicode.  Python 3.0 (also known as Python 3000 or py3k), a major, backwards-incompatible release, was released on 3 December 2008 after a long period of testing. Many of its major features have been back ported to the backwards-compatible Python 2.6 and 2.7. Python has twice been awarded as TIOBE Programming Language of the Year (2007, 2010), which is given to the language with the greatest growth in popularity over the course of the year (as measured by the TIOBE index).

Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.

Python runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java and .NET virtual machines. Python is free to use, even for commercial products, because of its OSI-approved open source license

Unlike languages like C/C++/Java, Python is extremely friendly to beginners. It is also a modern, powerful general purpose programming language used by companies and research institutions all over the world to solve complex computing problems.

Monday, 2 May 2011

My First Project


     LISP is a family of computer programming languages with a long history and a distinctive, fully parenthesized syntax. In my project i have a web application where we can type the commands in LISP language using a browser  and the interpreted output will be displayed on the web browser.The tools used here is  python (Back end) and  HTML/Javascript (Front end).