Python

Showing 46-49 of 49 results
EngineeringIcon ChevronTechnology

An Introduction to Mocking in Python

by Naftuli Kay

More often than not, the software we write directly interacts with what we would label as "dirty" services. In layman's terms: services that are crucial to our application, but whose interactions have intended but undesired side-effects—that is, undesired in the context of an autonomous test run. For example: perhaps we're writing a social app and want to test out our new 'Post to Facebook feature', but don't want to _actually_ post to Facebook every time we run our test suite. The Python `unittest` library includes a subpackage named `unittest.mock`—or if you declare it as a dependency, simply `mock`—which provides extremely powerful and useful means by which to mock and stub out these undesired side-effects.

9 minute readContinue Reading
EngineeringIcon ChevronTechnology

Why Are There So Many Pythons? A Python Implementation Comparison

by Charles Marsh

Python is amazing. Surprisingly, that's a fairly ambiguous statement. What do I mean by 'Python'? Do I mean Python the abstract interface? Do I mean CPython, the common Python implementation? Or do I mean something else entirely? Maybe I'm obliquely referring to Jython, or IronPython, or PyPy. Or maybe I've really gone off the deep end and I'm talking about RPython or RubyPython (which are very, very different things). While the technologies mentioned above are commonly-named and commonly-referenced, some of them serve completely different purposes (or at least operate in completely different ways). In this post, I'll start from scratch and move through the various Python implementations, concluding with a thorough introduction to PyPy, which I believe is the future of the language.

10 minute readContinue Reading
EngineeringIcon ChevronMobile

Control Your Laptop with an Android Phone using Python, Twisted, and Django

by Martin Chikilian

It’s always fun to put your programming skills on display. A while back, I figured it’d be cool to try and control my laptop via my Android mobile device. Think about it: being able to play and pause music, start and stop programming jobs or downloads, etc., all by sending messages from your phone. Neat, huh?

6 minute readContinue Reading
EngineeringIcon ChevronData Science and Databases

How I Made Porn 20x More Efficient With Python Video Streaming

by Gergely Kalman

Porn is a big industry. There aren’t many sites on the Internet that can rival the traffic of its biggest players. And juggling this immense traffic is tough. To make things even harder, much of the content served from porn sites is made up of low latency live streams rather than simple static video content. But for all of the challenges involved, rarely have I read about the developers who take them on. So I decided to write about my own experience on the job.

7 minute readContinue Reading

Join the Toptal® community.