Friday 25 September 2020

                  Packages In Python  How  To  use   Them 

package is a folder in python in which we have  modules .each file in that folder with .py extension can be a mudule.

  syntax  how to use  module  in python program:

             "form packagename  import modulename"  Here below detailed  video

        


Sunday 13 September 2020

                                               Variable Scope  in Python 

      Variables in python have scope means upto where they are visible where they are not visible it is explained by below video of mine

       


Saturday 12 September 2020

                                                    Recursion


When a function Calls itself it is recursive function. It forms a loop when it will do recursion. internally recursion is implemented using  Stack data structure by the compiler.




Wednesday 2 September 2020

Command Line Arguments and argparse In python

         Command Line Arguments are passed at command prompt  while program is going for running 

in python no direct mechansim to pass command line arguments  we have argparse module in python to support command line arguments

                      


Command Line Argument Python Code execution




    

Saturday 29 August 2020

Nested Loop in Python

        

         Loop means repeating a group of statements for given number of times . 

    If you nest a Loop what happens one loop is kept inside another loop

so the outer and inner each itration of outer loop makes inner loop to run from starting to ending . outer loop 10 iterations  means 10 times inner loop completely repeated 

         


Tuesday 25 August 2020

About Python Virtual Machine

                                                About Python Virtual Machine

     As a programmer, we all know that a computer only understands machine language and every programming language converts its code to machine language. This is done by a compiler of that language. The Python compiler also does the same thing but in a slightly different manner.

When we run a Python program, two steps happen,
  1. The code gets converted to another representation called ‘Byte Code’
  2. ‘Byte Code’ gets converted to Machine Code (which is understandable by the computer)
The second step is being done by PVM or Python Virtual Memory. So PVM is nothing but a software/interpreter that converts the byte code to machine code for given operating system.
 
PVM is also called Python Interpreter and this is the reason Python is called an Interpreted language.
 
PVM(Python Virtual Machine) 
We can’t see the Byte Code of the program because this happens internally in memory.
 
But if we want to see the byte code of the program execute the below command:
 
D:\> python -m py_complie x.py
 
Here we are calling the Python compiler with the  -m option. -m represents module and the module name is py_compile. This module generates the .pyc file for .py file. *.pyc file contains the byte code of the Python program. One can open and see the byte code representation of the python program. To convert byte code into machine code/output use:
 
D:\> python <nameofpycfile>.pyc
 
Here Python would skip the step of byte code generation and would convert byte code directly to machine code.
This a brief About Python Virtual Machine

                  Packages In Python  How  To  use   Them  package is a folder in python in which we have  modules .each file in that folde...

Python For beginner