Skip to main content

Introduction Phyton3

Why Phyton:

There is some points to choose phyton,
1 - Free & open source: , It's high Level language
2 - portable & extensible: (Write once run in any platform or windows) , extensivility means you can integrate the java , asp.net , C, C++ libraries component into the python
3 - Web development : Python has great frameworks to develop web like ( django,flask,pylons,web2py )
4 - Artificial Intelligence & Machine learning: AI is the next future development of tech world, Python fully support the AI program and features, AI provides some libraries which is helpful the develop this type of features. like below

  • scikit learn  (for complex calculations)
  • keras & tensorflow ( for machine learning )
  • opencv (for image/face recognition and hndwriting etc)

5- Computer Graphics : Python can develop the GUI, desktop application,game application , To do this type of applications , It has some libraries like below

  • Tkinter ( for GUI)
  • jython ( for python script seemless access to java)
  • wxpython (open source for window application)
  • pygame ( for game on android)
6- Testing frameworks : It Support testing cross plateform , cross browser , It has built in frameworks which covers debugging time and fastest workflow,
  • splinter
  • pytest
7- Big data : It can handle big data, parallel computing, libraries are 
  • hadoop
  • pydoop
  • dask
  • pyspark
8- scripting automation: Python can work as a scripting language, With in a script you can perform multiple tasks, they are interprated rather than compile, 
It executes the scripts machine read and interprets and check the error during run time.

9- Data science : Python is the leading language of many data scientist. It well suited for data manipulation and analysis. Deals with tabular data, arbitrary matrix data, observational statistical data,
  • Numpy
  • Pandas
  • Matplotlib
  • seaborn

High level vs low level language : Computer  Understand only the binary languages 0 , 1 , it's very 


difficult to work on binary language, Then comes the concept of assembly language, also called the low level language, for exp,
mov a,b   or add 5H etc , 
assembly language also need translator to do this type of operations,
After that comes the concept of High level language,  High level language is much similar to spoken English, now days most of the languages are high level language like C, java,python etc


Python is interpreted language instead of compile language , It interpret the code during the run instead of compile before the execution.  compiler first compile the whole code if there is any error it will through the error, while interprator interprat the code line by line during the run.

Some Basic Points of Phyton : 
no semicolon at the end
variabale declare would be simple name without dollar
concatenate two string or variable by + or , insteed of . in php
comment code by #
\n (newline), \t (tabspace) ,''' or """ can print as it is
type function can return the data type of a variable, like str,int,float
a=b=c = 3 , i.e all have 3 value
a,b = 3,4 i.e a and b have 3 and 4 value value
get a part of string is by index value, like variable_name[0],for first char
name = 'dharmendra' print('dra' in name) , return true if find substr in the string
indentation is required, while creating class,function,loop etc
if age >= 18:
    print("you are enough to vote")
elif age < 18:
    print("you r child man")
else:
    print('default')
number = "dharmendra singh"

for i in number


    print(i)

Data Types in Python : 



Comments

Popular posts from this blog

How to span column of custom table in Drupal

If you want to span the column of custom drupal table like below image, Follow the below code to make the header of the table , <?php $header = array('S.N','District', array('data' => '<div class ="house">Household </div><br><span>Rural</span> <p>Urban</p>','colspan' => 2), array('data' => '<div class ="house">Members</div> <br><span>Rural</span> <p>Urban</p>','colspan' => 2), 'Duplicate/Failed Registration', array('data' => '<div class ="house">Pending De duplication </div><br><span>Rural</span> <p>Urban</p>','colspan' => 2), 'Non Un-organised Workers', 'SSID Generated', 'No. of Card Personlised', ); $rows[] = arra...

Drupal 8 : Link actions,Link menus,Link Tasks,Routings

Drupal 8 : Link actions,Link menus,Link Tasks,Routings Link actions Local actions have also been moved out of the hook_menu() system in Drupal 8 .Use actions to define local operations such as adding new items to an administrative list (menus, contact categories, etc). Local actions are defined in a YAML format, named after the module they are defined by. Such as menu_ui.links.action.yml for this example from menu_ui module: menu_ui.link_add:   route_name: menu_ui.link_add   title: 'Add link'   appears_on:     - menu_ui.menu_edit Here, menu_ui.link_add: It is the Unique name of the link action Most likely start with module name, route_name : Name of the route it means when click the link it redirect to this route, appears_on :  An array of route names for this action to be display on. Now how to know the Route name of any internal/external admin pages like below, By through the drupal console we achieve it, drupal debug:router...

Cache In Drupal

Drupal 8 core caching modules: The Internal Page Cache module: this caches pages for anonymous users in the database. Pages requested by anonymous users are stored the first time they are requested and then are reused for future visitors. The Internal Dynamic Page Cache module: This is a key feature that Drupal 7 did not have. Unlike the Internal Page module, the Dynamic Page module aims to speed up the site for both anonymous and logged-in users. How Cache Works in Drupal: There are two modules available in the drupal core 1 - Internal page cache: The Internal Page Cache module caches pages for anonymous users in the database. Pages requested by anonymous users are stored the first time they are requested and then are reused. Configuring the internal page cache :   From the performance page we can set the maximum time how long browsers and proxies may cache pages based on the Cache-Control header. 2 - Internal dynamic page cache: Drupal 8 provides the Dynamic Page Cache m...