Sunday 11 November 2012

Python Introduction



Python is a general-purpose, interpreted high-level programming language whose design philosophy emphasizes code readability. Its syntax is said to be clear and expressive. Python has a large and comprehensive standard library.

About Python
Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. Python is often compared to Tcl, Perl, Ruby, Scheme or Java.

Some of its key distinguishing features include:

  • very clear, readable syntax
  • strong introspection capabilities
  • intuitive object orientation
  • natural expression of procedural code
  • full modularity, supporting hierarchical packages
  • exception-based error handling
  • very high level dynamic data types
  • extensive standard libraries and third party modules for virtually every task
  • extensions and modules easily written in C, C++ (or Java for Jython, or .NET languages for IronPython)
  • embeddable within applications as a scripting interface

Python runs everywhere
Python is available for all major operating systems: Windows, Linux/Unix, OS/2, Mac, Amiga, among others. There are even versions that run on .NET and the Java virtual machine. You'll be pleased to know that the same source code will run unchanged across all implementations.

Your favorite system isn't listed here? It may still support Python if there's a C compiler for it. Ask around on news:comp.lang.python - or just try compiling Python yourself.
Lets start with basic.

Python is considered an interpreted language because Python programs are executed by an
interpreter. There are two ways to use the interpreter: interactive mode and script mode.
In interactive mode, you type Python programs and the interpreter displays the result:
>>> 1 + 1
2
The chevron, >>>, is the prompt the interpreter uses to indicate that it is ready. If you type
1 + 1, the interpreter replies 2.

Alternatively, you can 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.


Working in interactive mode is convenient for testing small pieces of code because you can
type and execute them immediately. But for anything more than a few lines, you should
save your code as a script so you can modify and execute it in the future.

You can download Python from download python. 


No comments:

Post a Comment