Python is famous for coming with batteries included. Sophisticated capabilities are available in the standard library. You can find modules for working with sockets, parsing CSV, JSON, and XML files, and working with files and file paths. However great the packages included with Python are, there are many fantastic projects available outside the standard library. […]
Author: Real Python
Python "while" Loops (Indefinite Iteration)
Iteration means executing the same block of code over and over, potentially many times. A programming structure that implements iteration is called a loop. In programming, there are two types of iteration, indefinite and definite: With indefinite iteration, the number of times the loop is executed isn’t specified explicitly in advance. Rather, the designated block […]
Writing Comments in Python (Guide)
When writing code in Python, it’s important to make sure that your code can be easily understood by others. Giving variables obvious names, defining explicit functions, and organizing your code are all great ways to do this. Another awesome and easy way to increase the readability of your code is by using comments! In this […]
Setting Up Python for Machine Learning on Windows
Python has been largely used for numerical and scientific applications in the last years. However, to perform numerical computations in an efficient manner, Python relies on external libraries, sometimes implemented in other languages, such as the NumPy library, which is partly implemented using the Fortran language. Due to these dependencies, sometimes it isn’t trivial to […]
Python Community Interview With Michael Kennedy
This week, our Python community interview is with none other than Michael Kennedy of Talk Python to Me fame. You may know his authoritative voice, but do you know his Python story? Read on to find out about his journey with Python, what he thinks about when stuck in traffic, and his love for two […]
Practical Text Classification With Python and Keras
Imagine you could know the mood of the people on the Internet. Maybe you are not interested in its entirety, but only if people are today happy on your favorite social media platform. After this tutorial, you’ll be equipped to do this. While doing this, you will get a grasp of current advancements of (deep) […]
Getting Started With Testing in Python
This tutorial is for anyone who has written a fantastic application in Python but hasn’t yet written any tests. Testing in Python is a huge topic and can come with a lot of complexity, but it doesn’t need to be hard. You can get started creating simple tests for your application in a few easy […]
Python, Boto3, and AWS S3: Demystified
Amazon Web Services (AWS) has become a leader in cloud computing. One of its core components is S3, the object storage service offered by AWS. With its impressive availability and durability, it has become the standard way to store videos, images, and data. You can combine S3 with other services to build infinitely scalable applications. […]
Python’s range() Function (Guide)
Python’s built-in range function is a handy tool to know you need to perform an action a specific number of times. By the end of this article, you’ll: Understand how Python’s range function works Know how the implementations differ in Python 2 and Python 3 Have seen a number of hands-on range() examples Be equipped […]
Python Community Interview With Mike Grouchy
If you saw the last Python Community Interview with Mahdi Yusuf, then you have already met one half of the Pycoder’s Weekly team. This time, I’m joined by Mahdi’s partner in crime, Mike Grouchy. Mike tells us how Pycoder’s really began and what it means to be a “hoops junkie.” We’ll also learn more about […]
How to Round Numbers in Python
It’s the era of big data, and every day more and more business are trying to leverage their data to make informed decisions. Many businesses are turning to Python’s powerful data science ecosystem to analyze their data, as evidenced by Python’s rising popularity in the data science realm. One thing every data science practitioner must […]
Building and Documenting Python REST APIs With Flask and Connexion – Part 2
In Part 1 of this series, you used Flask and Connexion to create a REST API providing CRUD operations to a simple in-memory structure called PEOPLE. That worked to demonstrate how the Connexion module helps you build a nice REST API along with interactive documentation. As some noted in the comments for Part 1, the […]
Splitting, Concatenating, and Joining Strings in Python
There are few guarantees in life: death, taxes, and programmers needing to deal with strings. Strings can come in many forms. They could be unstructured text, usernames, product descriptions, database column names, or really anything else that we describe using language. With the near-ubiquity of string data, it’s important to master the tools of the […]
Color Spaces and How to Use Them With OpenCV and Python
It may be the era of deep learning and big data, where complex algorithms analyze images by being shown millions of them, but color spaces are still surprisingly useful for image analysis. Simple methods can still be powerful. In this article, you will learn how to simply segment an object from an image based on […]
Python Community Interview With Mahdi Yusuf
Today I’m joined by Mahdi Yusuf, one of the founders of Pycoder’s Weekly. By day he’s the CTO of Gyroscope, the OS for the human body. By night, he’s a sports and movie fan with a controversial opinion on who is the best Batman… Let’s get into it. Ricky: Let’s start with an easy one. […]