Introduction and installation
- Simple and Easy to Learn.
- Free and Open Source
- High-level Language
- Interpreted - It does not need compilation into binary, program is directly from the source code. Internally, Python converts the source code into an intermediate form called byte-codes and then translates this into the native language of your computer and then runs it.
- Procedure-oriented and object-oriented programming support
- Extensible and embeddable - It can be used along with c/c++, java , etc.
- Diverse and growing community - It is one of the most important feature of python from developer perspective. Python Standard Library is huge which support to various things involving regular expressions,documentation generation, unit testing, threading,databases, web browsers, CGI, FTP, email, XML, XML-RPC, HTML, WAV files,cryptography, GUI (graphical user interfaces), and other system-dependent stuff.
- Its important, python has various implementation like Cpython(C), Jpython(Java), IronPython(C#), etc. Refer this for more detail.
Default implementation is Cpython (it is developed in C language) and it is interpreted language and program is executed on CPython Virtual Machine. In further post and when we say python, we actually mean Cpython. Languages like java, C# have extended default implementation and developed IronPython and Jpython respectively.
Installation of Python in windows:-The very first step which is required to start learning python is to install a stable version of python.
1. Download python executable : Python for windows can be downloaded from here. Suppose we have installed python in C drive and it will be available at "C:\Python27"(Assume you have installed python 2.7 version).
2. Update environment variable (Optional) : It is good practice to add python installed directory in environment variable under path. Here "C:\Python27" should be added as system variable under path.For reference see below diagram:
|Add "C:\Python27" under system variables section in path.|
1. Open command prompt -> type python and hit enter.
If you see a few lines of information followed by the Python prompt >>> , it indicates python has been installed successfully and you are ready to GO!! and the window which is appearing now is python interpreter window. Now, write your first sample program in python. IN python interpreter just type print "Hello World!!" and it will respond with Hello World!!.
2. Go to All programs -> Python 2.7-> Python (command line). Once you click Python (command line), python interpreter appears and here you can write python program. Lets do sum of two number and display result.
We have installed python successfully and wrote Hello world, sum program. Its time to move on with fundamentals of python and built-in data structure in python and its uses.It will be discussed in next section.
Read also: Why python is called interpreted language?
Next: Fundamentals of Python