python and its applications

Post on 13-Apr-2017

1.703 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

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#.

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.

Hello World! :)

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

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!

Already in love with Python <3

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")

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

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()

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)

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.

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)

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.

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

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

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

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

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.

A few more

Artificial Intelligence SimpleAI EasyAI

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

PygameA video game being developed by using Pygame

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.)

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.

TurtleA beautiful image created using Turtle module in Python

One More, Very Important

Post feed automatically on Facebook. ;)

”Happy Birthday, Someone!

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

”Thank You!

ANY QUESTIONS?

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

Abhijeet Pratap Singh

CSE15U002IIIT Trichy

top related