Python and its Applications

29
PYTHON AND ITS APPLICATIONS

Transcript of Python and its Applications

Page 1: Python and its Applications

PYTHON AND ITS APPLICATIONS

Page 2: Python and its Applications

CONTENTS

What is Python? Features Hello World :) More Features Few comparison of codes in C++, Java and Python. Applications for Python Applications of Python

Page 3: Python and its Applications

What is Python?Of course, I am not talking about snake.Python is a clear and Powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, Java or C#.

Page 4: Python and its Applications

Features

Uses an elegant syntax, making the programs you write easier to read. Easy-to-use Language. Comes with a large standard library that supports many

common programming tasks such as connecting to web, searching text with regular expressions, reading and modifying files.

Runs anywhere. Including Mac OS, Windows, Linux and Unix.  Free language in two ways: First, it doesn't cost a single penny and

second can be freely modified and redistributed.

Page 5: Python and its Applications

Hello World! :)

Just one line:-       print("Hello World")

Page 6: Python and its Applications

More Features

Variety of basic data types available: numbers, strings, lists and dictionaries.

Supports OOPs with classes and Multiple Inheritance. Codes can be grouped into modules and packages. Modules can be made in C or C++ or any other language. Has Automatic Memory Management. Frees us from manually allocate

and free memory in your code.  Cheers! Nothing like malloc() or free() that is used in C. Yeah!

Page 7: Python and its Applications

Already in love with Python <3

Page 8: Python and its Applications

Hello World

C++#include<iostream>using namespace std;int main(){cout << "Hello World!";return 0;}

Javapublic class HelloWorld{    public static void main(String[] args)    {        System.out.println("Hello World");    }}  

Pythonprint("Hello World")

Page 9: Python and its Applications

Swap Numbers

C++#include <iostream> 

using namespace std; 

int main()

 {

     int x = 5, y = 10, temp; 

     temp = x; 

     x = y;

     y = temp; 

    return 0;

 }

Javaclass SwapNumbers{   public static void main(String args[])    {     int x = 5, y = 5, temp;

     temp = x;     x = y;     y = temp;

    }}

Pythonx = 5

y = 10

x,y = y,x

Page 10: Python and its Applications

Printing Pattern

C++#include<iostream>using namespace std;int main(){    for( int i = 0; i < 5; i++)    {        for( int j = 0; j <=5; j++)            cout << "*";        cout << "\n";    }return 0;};        

Javapublic class JavaProgram{    public static void main(String args[])    {        int i, j;        for(i=0; i<5; i++)        {            for(j=0; j<=i; j++)            {                System.out.print("* ");            }            System.out.println();        }    }}

Pythonfor i in range(0, 5):

    for j in range(0, i+1):

        print("*", end="")

    print()

Page 11: Python and its Applications

Applications for Python

Web and Internet Development Frameworks such as Django Micro Frameworks such as Flask.

Internet Protocols HTML and XML E-mail Processing

More Libraries Requests(a powerful HTTP client library) and BeautifulSoup(a HTML

parser that handles all sort of oddball HTML)

Page 12: Python and its Applications

GooglePython provides the power behind the most popular search engine in the world – Google. The programming language can handle the traffic and computing needs of the search engine and its connected apps.

Page 13: Python and its Applications

Some more Applications for Python

Scientific and Numeric Scipy (collection of packages for mathematics, science and engineering) Raspberry pi (used to design Robots) Pandas (daily analysis and modeling library)

Desktop GUIs Tk GUI library Kivy (for writing multi touch applications)

Page 14: Python and its Applications

RoboticsRaspberry pi can be used as a brain to the robot to perform various actions and to react to the environment and the coding on a Raspberry pi can be done using python.

Page 15: Python and its Applications

GUI development To develop a cross-platform desktop application python can be used. Python has modules Tkinter, PyQt to support it.

Page 16: Python and its Applications

Applications of Python

Web Crawler Using library's like BeautifulSoup

Web Development Using Libraries like Django and Flask

Data Structures and Algorithms Using Libraries

Plugin Library

Page 17: Python and its Applications

Some more Applications of Python

Data Science Got some knowledge of Machine Learning and AI? You can

implement some algos to build your own. Networking

Implement some protocols SMTP, FTP, HTTP Cryptography

Encrypt and decrypt library, something like, RSA, RC4, DES Computer Vision

Page 18: Python and its Applications

Computer VisionYou can do interesting things such as Face detection, Color detection using Opencv with python

Page 19: Python and its Applications

Machine LearningPython can be used to  do cool things such as predicting stocks, fingerprint identification, spam detection etc. using machine learning. Python has modules scikit-learn, theano, tensorflow to support it. Currently Deep Learning is all the hype and Tensorflow has support for Deep Learning.

Page 20: Python and its Applications

A few more

Artificial Intelligence SimpleAI EasyAI

Games Pygame, A few are very popular: Pixel Man, Too many Troopers

Page 21: Python and its Applications

PygameA video game being developed by using Pygame

Page 22: Python and its Applications
Page 23: Python and its Applications

Some Interesting Applications

A great fan of TV Series or Anime? Python can download all this for you automatically.

Cricket Lover? Need score Updates? Python delivers all that quickly and free. :)

Have a messy collection of folders? Let Python arrange it for you. :) Get news Updates. Got many movies, don't know where to start from? Simple solution.

Write a python script to organize movies as per IMDB ratings. (And that’s too in a few lines of code.)

Page 24: Python and its Applications

A few more

Bored of the same wallpaper on the background? Ask python to download Bing images for you. Or download Pics from Instagram.

Create a file Server with just one line of code: python -m SimpleHTTPServer #default port 8080

Turtle: Python has built in turtle. Enjoy your childhood.

Page 25: Python and its Applications

TurtleA beautiful image created using Turtle module in Python

Page 26: Python and its Applications

One More, Very Important

Post feed automatically on Facebook. ;)

Page 27: Python and its Applications

”Happy Birthday, Someone!

Did you received Happy Birthday posts from me on Facebook? ;)Sorry for that.

Page 28: Python and its Applications

”Thank You!

ANY QUESTIONS?

PS: This is not Python Generated Page. ;) And the PowerPoint presentation too. :)

Page 29: Python and its Applications

Abhijeet Pratap Singh

CSE15U002IIIT Trichy