LearnWhat is Python Used For?

Kenneth Love
writes on July 8, 2014

Share with your friends










Submit

When I need to build a web app, I reach for Python. When I need to automate some small task on my system, I reach for Python. When I want to find the most common colors in an image, I reach for Python. When I…OK, I think you get the picture. Basically, when I need to code something and the language doesn’t matter, I use Python. So what is Python?

Python is a general purpose programming language created in the late 1980s, and named after Monty Python, that’s used by thousands of people to do things from testing microchips at Intel, to powering Instagram, to building video games with the PyGame library. It’s small, very closely resembles the English language, and has hundreds of existing third-party libraries.

So what are the major reasons why I, personally, choose Python and recommend it to as many people as possible? It comes down to three reasons.

Readability

Python very closely resembles the English language, using words like ‘not’ and ‘in’ to make it to where you can very often read a program, or script, aloud to someone else and not feel like you’re speaking some arcane language. This is also helped by Python’s very strict punctuation rules which means you don’t have curly braces ({ }) all over your code.

Also, Python has a set of rules, known as PEP 8, that tell every Python developer how to format their code. This means you always know where to put new lines and, more importantly, that pretty much every other Python script you pick up, whether it was written by a novice or a seasoned professional, will look very similar and be just as easy to read. The fact that my Python code, with five or so years of experience, looks very similar to the code that Guido van Rossum (the creator of Python) writes is such an ego boost.

Libraries

Python has been around for over 20 years, so a lot of code written in Python has built up over the decades and, being an open source language, a lot of this has been released for others to use. Almost all of it is collected on https://pypi.python.org, pronounced “pie-pee-eye” or, more commonly called “the CheeseShop”. You can install this software on your system to be used by your own projects. For example, if you want to use Python to build scripts with commandline arguments, you’d install the “click” library and then import it into your scripts and use it. There are libraries for pretty much any use case you can come up with, from image manipulation, to scientific calculations, to server automation.

Community

Python has user groups everywhere, usually called PUGs, and does major conferences on every continent other than Antarctica. PyCon NA, the largest Python conference in North America, sold out its 2,500 tickets this year. And, reflecting Python’s commitment to diversity, it had over 30% women speakers. PyCon NA 2013 also started a trend of offering “Young Coder” workshops, where attendees taught Python to kids between 9 and 16 years of age for a day, getting them familiar with the language and, ultimately, helping them hack and mod some games on the Raspberry Pis they were given. Being part of a such a positive community does a lot to keep you motivated.

I’m very excited to be able to share my favorite language with the Treehouse community and hopefully the pieces of Python that I love the most will help you decide to check it out and learn it with me.

Here’s a short video of Kenneth giving examples of the best uses of Python.


Learn in-demand programming skills and become a certified Python Developer with the Treehouse Techdegree Program. Learn more and enroll today.

24 Responses to “What is Python Used For?”

  1. A.Smirnov on September 7, 2016 at 8:41 pm said:

    Readability,Libraries,Community….
    I am sorry to say but I see it bit diffrently.

    Community : In my expirience it doesnt meant good thing (or bad). Lets look at PHP and the amount of horroble code…. Thats the problem with Community – bad code will be multiplied much more as good. So cant say its a plus point for Python either.

    Libraries: No language is perfect and of course at some point for something will need extention. Amount of extentions I need for Python is overwhelming… Python is good to automate some task, but first you have to automate it to get all Libaries, since it comes almost naked. So no real plus point

    Readability: Let me put it like this, I use 95% of the time C# and VBA. I have to say C# is readable and in VBA i have some question marks in my head…the same question marks are when i use Python. No real scoping in my expirience is not good and some Keywords make less sense to me. So again no real plus point

  2. first I jus wan say tnx , and what am about to ask you is can python works the same as java do?

  3. Adeoti Ayodeji on August 8, 2016 at 3:21 pm said:

    print “I love python, its just as easy as blinking my eye”
    Lol…. #just smiling in Python

  4. olamilekan on May 2, 2016 at 4:08 pm said:

    Since I started learning python it’s has really been fun all the way. It’s simple and easy to learn since it’s man’s language.

  5. shiv pratap singh on April 13, 2016 at 2:55 pm said:

    I am exited to learn python.

  6. this seems so fun

  7. Readability and lightweight (Django) to be the most important factor for us using it in various projects. But as Bjorn once put it – Python is the “v2/v3” double barrel shotgun, only one barrel will shoot at a time, and you never end up shooting the recommended one. Also I probably should have used a line tool to draw that. 😉

  8. Robin White on January 21, 2016 at 10:38 pm said:

    http://www.thedevmasters.com/3-reasons-why-you-should-learn-python/ is also really good article I found. I just wanted to share to you guys.

  9. I have want to fly with python ….It’s super……

  10. Python is dynamically typed: it means that you don’t declare a type (e.g. ‘integer’) for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = “hello” makes the variable name a to refer to a string containing “hello”. Static typed languages would have you declare int a and then a = 5, but assigning a = “hello” would have been a compile time error. On one hand, this makes everything more unpredictable (you don’t know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.
    Python is strongly typed. It means that if a = “5” (the string whose value is ‘5’) will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like “hello” + 5 to get “hello5”.
    Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on.
    Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.
    Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.

    • Very very informing. If we assume that all is correct :), those are really good informations for novice for python like me (mostly c#).

  11. Rajath Suresh on September 14, 2015 at 6:06 am said:

    This is really good. Impressed to learn python.

  12. chaitanya dandvate on August 31, 2015 at 5:43 am said:

    Great video clip !!!!!! I didn’t knew that python is used for so many diverse applications. Thanx for sharing this information

  13. Hi,

    I would like to know, is it possible to built a web app using python language??
    Is python HTML friendly ??
    If yes, to write an app will I need to have a server ??

    • Kenneth Love on August 24, 2015 at 9:26 am said:

      You can definitely write web apps using Python. Look at Flask, Django, and Pyramid, which are the three most popular Python web frameworks.

      And, yes, you’ll need a server that can run Python.

  14. Awesome 🙂 seems like a great addition to the teacher team aswell! Can’t wait.

  15. Welp, sign me up for this.

  16. Richard on July 10, 2014 at 8:00 am said:

    I am excited for this!

  17. So excited to hear about this course and to get Treehouse’s down to earth and practical take on learning Python.

  18. Josh Lopez on July 9, 2014 at 4:49 pm said:

    Hey Kenneth!
    Haven’t seen you since the forrst podcast. It’s good to see you are working with Treehouse now! Hope to bump in to you in Portland one of these days. Much Love!

  19. Wow, looks awesome. I may have to explore this once I am done with Javascript.

  20. Those “best use examples” are awesome, I am really excited to take this course. I have a feeling once I learn Python, I am going to want to increase my programming skills. Its like its never ending, always something to learn.

  21. Michail Shaposhnikov on July 8, 2014 at 4:39 pm said:

    Wow, this is really eye-opening. I can’t wait to start this course! 🙂

Leave a Reply

Want to learn more about Python?

Learn the general purpose programming language Python and you will be able to build applications and tools.

Learn more