What is Python Used For?

python

At Treehouse we are gearing up to launch a new course called ‘Python Basics’. It will be released later in July but for now teacher Kenneth Love talks about why you should consider learning the programming language named after Monty Python.

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.

Free Workshops

Watch one of our expert, full-length teaching videos. Choose from HTML, CSS or WordPress.

Start Learning

Comments

8 comments on “What is Python Used For?

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

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

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