You are on page 1of 6

ABOUT PYTHON

Python is a high-level programming language developed by Guido van Rossum in


1991 at National Research Institute for Mathematics, Netherlands. It is presently
owned by Python software Foundation (PSF).

Features of Python

➤ Python is an interpreted, interactive, directly executed language.

➤It is free open-source software having large repository of libraries.

➤It is extensible and highly efficient as there is no wastage of time in declaring


variables.

Advantages of Python

➤ Platform independent - It can run across different platforms like windows,


Linux, Mac OS and other OS.

➤Easy to use (Readability) - It uses simple, concise and English like instruction
that are easy to read and understand.

➤ High Productivity – It is a simple language with small codes and extensive


libraries. Therefore, it offers higher productivity to programmers as compared to
C++ and java.

➤Less learning time- Because of simple and shorter code, lesser time is required
to understand and learn python.

➤Syntax highlighting - It allows to distinguish between input, output and error


➤message by different color codes.

➤Interpreted language - Code execution & interpretation line by line.

How to work in Python


STARTING IDLE From Start Menu, open IDLE as follows: Start menu Apps by
name  IDLE (Python 3.7 32 bit) or Click on the icon to start IDLE It always starts
up in the shell.

Python IDLE comprises Python shell (Interactive mode) and Python Editor (Script
mode).

INTERACTING WITH PYTHON - PYTHON SHELL: Python shell is an interactive


window where you can type in the python code and seethe output on the same
window. It is an interface between the python command and the OS.
PYTHON-MYSQL CONNECTIVITY
➤ Database connectivity-Database connectivity refers to connection and
communication between an application and a database system.

➤ Any user interface designed in any programming language is Front End


whereas data given by database as response is known as Back-End database. SQL
is just a query language; it is not a database. To perform SQL queries, we need to
install any database for example Oracle, MySQL, MongoDB, PostgreSQL , SQL
Server, DB2 etc.

➤ The Python standard for database interfaces is the Python DB-API. Python
Database API supports a wide range of database servers, like MySQL, MySQL,
PostgreSQL, Informix, oracle, Sybase etc.
Steps for Creating Database connectivity Applications

➤Start python.

➤Import SQL interface with following command import mysql.connector.

➤ Open and establish a connection to database.

➤ Create cursor object

 A database cursor is a special control structure that facilitates row by row


processing and accessing of records in the result set (set of records retrieved
according the query).

➤Execute a query

 cursor.execute() method is used to execute SQL queries.

➤Extract data from result set.

➤Clean up the environment.


s that are easy to read and understand.

➤ High Productivity - It is a simple language with small codes and extensive


libraries. Therefore, it offers higher productivity to programmers as compared to
C++ and java.

➤ Less learning time- Because of simple and shorter code, lesser time is required
to understand and learn python.

You might also like