Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

python cool Tricks

What is Python?

  Python is a popular programming language and it is easy to learn. It was created by Guido van Rossum and first released in 1991, An excellent language for beginners it is very easy to understand. It enables clear programming on both small and large scales.

Python is the world’s most popular, requirement programming languages.

This is for many logics:

  • Easy To Learn

  • Super Versatile

  • It has a huge range of libraries and modules

 

Most of these ‘tricks’ are things we have used during our day-to-day work. Some Interesting things I got while browsing

 

When I started studying python I am completely amazed by its versatility. Python comes with an inbuilt Turtle graphics module and since then I have completely turned Python into my canvas. I spend my time playing with this module.

What Is A Graphical User Interface(GUI)

GUI is a desktop app which will help you to interact with all the different types of computers, and use to perform different tasks in the desktops, laptops, other electronic devices, etc..,

  • GUI apps like Text-Editors are used to create, read, update and delete different types of files.

  • GUI apps like Sudoku, Chess, Solitaire, etc.., are games which you can play.

  • GUI apps like Chrome, Firefox, Microsoft Edge, etc.., are used to surf the Internet.


1. Rotating Square

from turtle import Turtle

t = Turtle()

def polygon(n,theta):

   t.speed(0)

   t.right(theta)

   a = (180*(n-2))/n

   for x in range(n):

       t.forward(100)

       t.right(180 - a)

 

for i in range(180):

   polygon(4,i)

input('Press any key to continue...')

 

 

2. Spiraling squares

        from turtle import Turtle

        t = Turtle()

 

         def spiral(n):

           if n

                 t.forward(n)

                 t.right(89)

                 spiral(n+1)

 

          spiral(30)

          input('Press any key to continue...')



3.SnowFlake

from turtle import Turtle

t = Turtle()

t.speed(0)

#a = 180

b = 180

for c in range(5):

          a = 9*c

          for i in range(100):

          t.circle(i,a)

          t.right(b)

          t.circle(i,a)

          t.right(b)

          t.circle(i,a)

          t.right(b)

          t.circle(i,a)

          input('Press any key to continue...')

 

4. overlapping circular pattern

 

from turtle import Turtle

t = Turtle()

t.speed(0)

for x in range(150):

   t.circle(x)

t.right(90)

for x in range(150):

   t.circle(x)

t.right(90)

for x in range(150):

   t.circle(x)

t.right(90)

for x in range(150):

   t.circle(x)

input('Press any key to continue...')

 

5. XKCD Comics

            >>import antigravity

If you type this command on the terminal, you will get a cool comics in your browser like this

 

 

6. Calendar



Top Python libraries you can’t live without

1. Pytorch

Pytorch is an open source library, it mostly a replacement of  Numpy library, and it is furnished with higher-level functionality for building a deep neural network. Still, we can use a few other languages such as scipy, Cython, and numpy will help to extend PyTorch when it requires. Few more  organization like facebook, twitter, Nvidia, uber and other organization will use pytorch for rapid prototyping in research

2. Scrapy

Initially, it is designed for scrapping, Scrappy has generally used Python web scraping libraries, But now it is using for so many purposes data mining, automated testing, etc. scrappy is open-source and must have a library.

3. Pyflux

Pyflux is developed by Ross Taylor, Pyflux is a python library which is used to anticipate and analysis time series.in this library, we have many options for interface and contain many new classes of model types.

4. Ipython

Ipython is one of the best useful python tools, it provides a rich architecture to its user. This tool will allow you to write and execute a python program in your browser. It will work on different serval operating systems such as Mac OS X, Linux, UNIX OS, and other windows. Ipython will give all the basic interpreter with few extra features like numbers, more function, help function, advanced editing, etc.







This post first appeared on Windows Powershell Commands For Beginners, please read the originial post: here

Share the post

python cool Tricks

×

Subscribe to Windows Powershell Commands For Beginners

Get updates delivered right to your inbox!

Thank you for your subscription

×