TL; DR: Although Python can trace its roots to irreverence and Monty Python’s Flying Circus, Guido van Rossum’s programming language powers tech behemoths the likes of Google, YouTube, Dropbox, and Buzzfeed, among others. The short-and-sweet syntax helps development teams build programs and interfaces quickly, while enabling new hires to rapidly get up to speed. Our team shared their top libraries and features as we explored Python’s appeal and the creator’s aspirations.
And now for something completely different:
Actually, the story of Python is rather common to the tech world — a programmer needed something to keep him occupied while on Christmas break. Guido van Rossum chose to write an interpreter for a new scripting language he had been thinking about. Feeling cheeky, he called his project Python after Monty Python’s Flying Circus.
Almost three decades later, Python is the language behind Google, YouTube, and Mozilla, in addition to powering the software helping scientists with particle acceleration and looking for life on Mars.
Python, however, isn’t just for the tech elite. The language’s readability, simplicity, and powerful libraries have led folks to create programs for automating meal planning, scanning jail records for a relative’s name, and alerting coworkers when a new pot of coffee has been brewed.
As fans of efficiency and clean coding, we’ve gathered a list of the best features and extensions that show why Python is worth using and learning to develop your next application. Now, to kick this off with Guido’s favorite Monty Python quote: “Take it away, Eric the orchestra leader!”
3 Reasons Why We Love Python
We’re suckers for technologies with personalities, so what’s not to love about Python? Instead of foo and bar, Pythonistas — yep, that’s what they’re called — use spam and eggs in sample code, along with knights who say ['Ni']*3
.
1. Readable, Simple — and Short! — Syntax
From the beginning, Python was meant to provide a powerful yet elegant platform that enabled experienced programmers to code efficiently and let novice users learn quickly.
Gone are the obnoxious curly brackets and debates about how to format your code. Python organizes statements through indentation, reducing visual clutter and the likelihood of errors caused by errant or missing punctuation. The classic “Hello, world!” example illustrates the simplicity of Python compared to languages such as Java and C++:
Java:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } }
C++:
#includeint main() { std::cout Python:
print (“Hello, world!”)Python's uniform style makes code easier to understand, edit, and reuse. The language more closely follows the natural flow of spoken words, promoting a comfortable coding experience.
2. Interpreted Code Skips Compiling
The biggest gripe about Python is that it runs marginally slower than compiled languages, including Java and C++. Programs written in compiled languages have been optimized to run in a specific environment.
As an interpreted language, Python saves programmers the step of compiling code. Programs run natively on Mac, most Unix variants, and Windows 2000 and later.
Compiled languages are commonly used when performance is more valuable than cross-platform support. To run a program written in a compiled language, it must be manually compiled — if you're still debugging and testing your program, you'll have to compile code every time you want to test changes.
Interpreted languages do not require machine code to execute the program. Interpreters, built in the same language, instead run through the program and execute each command line by line. Python's interpreter enables programmers to test language features as they code.
3. Extensive Built-In Modules
Python had long maintained a "batteries included" philosophy, meaning it comes out of the box ready to use, with everything included. The rich and versatile standard library is immediately available without having to install separate packages.
The self-sufficient language comes with tools and support for various protocols, creating graphical user interfaces, connecting to relational databases, arithmetic, parsing, and testing. Many high-use programming tasks and features are included in the standard library, further reducing the time and length it takes to code.
10 Libraries We Recommend to Expand Your Python Experience
The Python Package Index, or PyPI, hosts thousands of third-party packages to extend or replace standard functionalities of the language. Here are 10 helpful libraries, in no particular order — with a handful of bonus options thrown in:
- Requests: Python's standard urllib2 module is sufficient for HTTP requests to other servers, but the Requests library's API is much more intuitive and functional.
- Scrapy: A must-have option for extracting data from websites, Scrapy is a fast and simple tool for building, running, and deploying web spiders. Beautiful Soup is also a respected, if slower, HTML parsing library and scraping tool.
- Flake8: Test your code for style and formatting while also detecting common errors. Flake8 integrates with most IDEs.
- IPython: Providing a rich architecture for interactive computing, IPython supports data visualization, parallel computing, code completion, and shell capabilities.
- Splinter: Used for testing web applications, Splinter automates browser actions such as visiting URLs and interacting with various elements. Nose has historically been the go-to testing framework but is fading in maintenance mode.
- Pillow: Dubbed "the friendly PIL fork," Pillow continued development of the standard Python Imaging Library and is more user friendly.
- Peewee: A small but expressive object-relational mapping tool, Peewee supports SQLite, MySQL, and PostgreSQL. Models are easy to construct, connect, and manipulate.
- Apache Libcloud: A unified mechanism for dealing with dozens of cloud providers, this library provides common tools to utilize the various methods for manipulating cloud resources.
- Sanic and uvloop: The fastest web framework by a clear margin, Sanic is a Python 3.5+ web server designed for speed. Pairing it with uvloop provides an added boost over the asyncio module. Cython is another option for accelerating Python code by compiling it to C.
- Arrow: Python is unaware of time zones but comes with several modules for managing datetimes. Arrow helps users create, manipulate, format, and convert dates, times, and timestamps with a helpful interface.
We skipped over common frameworks, including Django and Flask, but there are many packages worth exploring. PyPI Ranking lists the most popular libraries, both of all time and per week.
How Google, Mozilla, and Other Major Tech Companies Use Python
Quora Founders Adam D'Angelo and Charlie Cheever considered C#, Java, and Scala in addition to Python when starting the question-and-answer website. They were concerned about Python's speed but found the language to be fast enough for most of their needs (performance-critical code is pushed to C++ when possible).
"We also had a lot of confidence that Python would continue to evolve in a direction that would be good for the life of our codebase," Adam wrote in — what else — a Quora answer. "We've been pretty happy with the choice. All of the early employees who'd been working with other languages in the past were happy to transition to Python."
The employee-code relationship has been important to several elite tech companies, with many contributing testimonials to a brochure of success stories the Python Software Foundation uses to promote the language.
Much of Google is written in Python, along with the search engine's App Engine, several APIs, and the developer website.
"Python has been an important part of Google since the beginning and remains so as the system grows and evolves," Director of Research Peter Norvig said in the brochure. "Today, dozens of Google engineers use Python, and we're looking for more people with skills in this language."
The Mozilla Foundation, the maker of Firefox and Thunderbird, uses Python for its addon and support websites, along with its crash-reporting and synchronization systems.
"Python's concise syntax is simple and yet highly productive," Staff Application Engineer Tarek Ziadé said. "This means that new developers can very quickly get involved in our projects, even if they are not yet familiar with Python."
SurveyMonkey was originally running a single C# and .NET application that became too slow to add, test, and deploy new features. The team rewrote the application in Python, breaking core features into separate services.
"Developers have found it possible to add new features much more quickly than before," Head of Engineering Chuck Groom said. "New employees get up to speed in a manner of days, and recruiting has become easier."
The Benevolent Dictator For Life's Quest for an Elegant Language
Since creating Python, Guido has moved continents and jobs. Born and raised in the Netherlands, he parlayed Python into jobs in the US at Google and, currently, Dropbox.
From the beginning, appealing to Unix or C programmers seemed to be his Holy Grail (interestingly, he later created a web browser in Python called Grail).
Guido helped create the ABC programming language in the early 1980s. Geared toward non-professional programmers, ABC was used more for teaching and prototyping instead of systems programming. The language introduced the organization-by-indentation concept but was a self-contained system with only a few operations.
Guido sought to improve upon ABC by boosting efficiency and creating more options for seasoned developers. For example, ABC came with an integrated structured editor; Python relies on Unix infrastructure without being Unix-bound — in fact, the first implementation was done on a Mac.
Python was also influenced by Modula-3 and C — "but only the least controversial features, in my desire to please the Unix/C audience," Guido wrote in a foreword for Programming Python.
Guido is quick to attribute Python's success to a community of early adopters, along with the thousands of users and contributors as the language gained popularity. Those early adopters bestowed Guido with the title of Benevolent Dictator for Life and final design authority rights over the language.
"They sent me their praise, criticism, feature requests, code contributions, and personal revelations," Guido wrote. "They were willing to discuss every aspect of Python and educate me or nudge me in the right direction when my initial intuition failed me."
Now, development is largely conducted through Python Enhancement Proposals, or PEPs, which are the mechanism for proposing new features, collecting input, and documenting decisions.
And now, because we've come to the end and can't help ourselves from throwing in one more Monty Python reference: "Go away, or I shall taunt you a second time."
HostingAdvice.com is a free online resource that offers valuable content and comparison services to users. To keep this resource 100% free, we receive compensation from many of the offers listed on the site. Along with key review factors, this compensation may impact how and where products appear across the site (including, for example, the order in which they appear). HostingAdvice.com does not include the entire universe of available offers. Editorial opinions expressed on the site are strictly our own and are not provided, endorsed, or approved by advertisers.
Our site is committed to publishing independent, accurate content guided by strict editorial guidelines. Before articles and reviews are published on our site, they undergo a thorough review process performed by a team of independent editors and subject-matter experts to ensure the content’s accuracy, timeliness, and impartiality. Our editorial team is separate and independent of our site’s advertisers, and the opinions they express on our site are their own. To read more about our team members and their editorial backgrounds, please visit our site’s About page.