Wednesday, September 23, 2020

Overview of Python.. How it Works....!!!!

 

How does Python Work

        As a Computer science student...  we usually get to know the basics of all the languages.. and once u  get across few languages we will come to the conclusion that Python is a much easier language syntactically, and human friendly..

     This made me ask myself how actually Python works. This made me to research more on python gave me more details about python and how actually it works. We can get to know everything...!!!



Python Interpreted

           When u write programs in C, you have to compile the code which involves translation of the human readable code to machine code, which is the basic level code that the machine CPU can understand and execute.
            Python is a interpreted language. So what is interpreted..? How is it different from compiled Languages..? So , Python code written in .py file is compiled to a bytecode which is stored as .pyc or .pyo format.  Bytecode is a low level set of instructions that a interpreter can understand and execute.
The location of the interpreter in pc's is mostly /user/local/bin/python3.8 . So instead of executing the code in CPU, it is executed in a virtual machine.

            The popular advantage of interpreted languages are.. they are platform independent. As long as the version of python and the virtual machine is same, it can be executed in any platform(Windows, MacOS, Linux, etc..)

            Python is Dynamically typed Language so that we don't need to declare the type of the variable,  It is the work of the interpreter to validate the variable and the operations on it.


Python is slow?

            The major disadvantage of the python language is being "SLOW". So lets see to this with a simple example for why it is slow in execution. Think of it this way. If you can talk in your native Language to someone, that would generally work faster than having a mediator having to translate your language into some other language for the listener to understand.  So this is the same way python works and that's the reason for python to be slow.




    

No comments:

Post a Comment

Full Stack Developer

  A full stack web developer is a person who can develop both client and server software. In addition to mastering HTML and CSS, he/she al...