LearnWhat is Python used for?

   
Avatar

Kenneth Love
writes on July 8, 2014

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

When I need to build a web app, I reach for the Python programming language. 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 used for?

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 language’s creator) writes is such an ego boost.

Libraries

Python has been around for over 20 years, so a lot of code has built up over the decades and, being an open source programming 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, sells 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. Check out PyCon to find your nearest Python conference.

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 Python it with me.

Read more content about Python on our blog, or watch 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.

GET STARTED NOW

Learning with Treehouse for only 30 minutes a day can teach you the skills needed to land the job that you've been dreaming about.

Get Started

40 Responses to “What is Python used for?”

  1. Privileged to read this informative blog on Python. Commendable efforts to put on research the data on Python tutorial. Please enlighten us with regular updates on Python course. Friends if you’re keen to learn more about Python training you can watch this amazing tutorial on the same.

  2. Nice article. Thank you so much.

  3. Can we develop online android app using python

  4. One thing I just need to be clear. For web programming, Java is one of the best choices for large-scale application. But Python is best for what?

  5. Hi
    is there any formal education requirened to use python as a script language (e.g being a software engineer)?
    or anyone with common reason can ise python to control his work-environemt softwares?

    • No. You don’t have to be a software engineer for learning python but yes you need to have a basic understanding for a programming language. That will help you a lot.

  6. Bashorun Ahmed on September 2, 2017 at 4:47 pm said:

    does python has is own server and what is it called

  7. Hi. Which would you recommend? Should I learn R first or learn Python first?

  8. Been wondering what language should I learn next.. Guess I foud the answer now 🙂

  9. Python is such a fun to learn. Can it be used to write an interactive desktop and mobile app? And if, what are the tools in python that can be deployed for the purpose.

  10. Fantastic article I am going to learn Python with the goal of teaching my daughter.

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

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

    • John Anselmo on July 15, 2017 at 9:04 pm said:

      Hi Israel,

      Python is a programming language and so is Java. So the answer is yes, they can be both used to do similar things, but their syntaxes are different. Python is simply

      print(“Hello world”)

      While in Java, the same thing would be:

      System.out.println(“Hello world”);

      So they can both do the same thing, so if you learn one, you’ll be familiar with the logic behind the other, but you’ll have to learn the syntax :).

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

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

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

    I am exited to learn python.

  16. 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. 😉

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

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

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

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

    This is really good. Impressed to learn python.

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

  22. 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 ??

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

  24. Welp, sign me up for this.

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

    I am excited for this!

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

  27. 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!

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

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

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

You must be logged in to post a comment.

man working on his laptop

Are you ready to start learning?

Learning with Treehouse for only 30 minutes a day can teach you the skills needed to land the job that you've been dreaming about.

Start a Free Trial
woman working on her laptop