Python learning

Introduction and installation 

Python is a programming language with very long and rich history and proclaimed to be simple and powerful. Indeed, it's simplicity and its usefulness in scientific community is the main reason behind its  popularity and of course, role of MIT and Google to make it popular among developer community cannot be denied. Initially, python was known for accomplishing automation task, however with advancement of time various notable applications written in Python like : Original version of the Google crawler, installer for RedHat, named "anaconda". History of python can be read here (Wikipedia). In summary features of python (From byte of python by Swaroop C H) :
  1. Simple and Easy to Learn.
  2. Free and Open Source
  3. High-level Language 
  4. 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.
  5. Portable 
  6. Procedure-oriented and object-oriented programming support
  7. Extensible and embeddable - It can be used along with c/c++, java , etc. 
  8. 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.
  9. 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.
Test Python installation:- Python is formally an interpreted language, in order to execute python program we need to open python interpreter.Python interpreter can be launched in a number of ways, let's see two most common ways to do the same:
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!!.
    >>>  print "Hello World!!"
    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.
    >>>  print 12+23
   35
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

5 Comments

  1. Hi, I run a travel agency in Seattle and I always look to expand my business virtually instead of physical appearance everywhere. What do you think that how python language and this technology related stuff can help our business to expand in all other major cities of U.S. Here's a business link http://danitravelswell.com, pls check it and let me know is it possible?

    ReplyDelete
  2. Thanks for the informative post. Love the Content. Your Blog are Very interesting.
    Learn about- software companies

    ReplyDelete
  3. My fiancé and I are currently planning our dream wedding in Arlington for next summer. We're on the lookout for a talented wedding photographer who can capture our special day beautifully. Any recommendations or personal experiences with photographers in the area would be greatly appreciated! I will visit that photography service before hiring it.

    ReplyDelete
Previous Post Next Post