LBYL vs. EAFP: Preventing or Handling Errors in Python

In this tutorial, you'll learn about two popular coding styles in Python: look before you leap (LBYL) and easier to ask forgiveness than permission (EAFP). You can use these styles to deal with errors and exceptional situations in your code. You'll dive into the LBYL vs EAFP disc … | Continue reading


@realpython.com | 1 year ago

Python 3.11 Preview: Task and Exception Groups

Python 3.11 will be released in October 2022. In this tutorial, you'll install the latest alpha release of Python 3.11 in order to preview task and exception groups and learn about how they can improve your asynchronous programming in Python. | Continue reading


@realpython.com | 2 years ago

YAML: The Missing Battery in Python

In this tutorial, you'll learn all about working with YAML in Python. By the end of it, you'll know about the available libraries, their strengths and weaknesses, and the advanced and potentially dangerous features of YAML. You'll also serialize Python objects and create a YAML s … | Continue reading


@realpython.com | 2 years ago

Build a Site Connectivity Checker in Python

In this step-by-step project, you'll build a Python site connectivity checker for the command line. While building this app, you'll integrate knowledge related to making HTTP requests with standard-library tools, creating command-line interfaces, and managing concurrency with asy … | Continue reading


@realpython.com | 2 years ago

Python's Urllib.request for HTTP Requests

In this tutorial, you'll be making HTTP requests with Python's built-in urllib.request. You'll try out examples and review common errors encountered, all while learning more about HTTP requests and Python in general. | Continue reading


@realpython.com | 2 years ago

Python 3.11 Preview: Even Better Error Messages – Real Python

Python 3.11 will be released in October 2022. In this tutorial, you'll install the latest alpha release of Python 3.11 in order to preview one of its anticipated features: more precise error messages that'll help you debug your code more efficiently. | Continue reading


@realpython.com | 2 years ago

What happened to Python in February 2022?

In February 2022, Python 3.11 Alpha 5 was released, and the schedule for the upcoming PyCon US became available. In this article, you'll get the details of these exciting events and catch up on other important developments in the world of Python. | Continue reading


@realpython.com | 2 years ago

Python Debugging with Pdb

In this hands-on tutorial, you'll learn the basics of using pdb, Python's interactive source code debugger. Pdb is a great tool for tracking down hard-to-find bugs and allows you to fix faulty code more quickly. | Continue reading


@realpython.com | 2 years ago

Representing Rational Numbers with Python Fractions – Real Python

In this tutorial, you'll learn about the Fraction data type in Python, which can represent rational numbers precisely without the rounding errors in binary arithmetic. You'll find that this is especially important in financial and other high-precision applications. | Continue reading


@realpython.com | 2 years ago

Python's Sum(): The Pythonic Way to Sum Values

In this step-by-step tutorial, you'll learn how to use Python's sum() function to add numeric values together. You also learn how to concatenate sequences, such as lists and tuples, using sum(). | Continue reading


@realpython.com | 2 years ago

Python 3.10: Cool New Features for You to Try

In this tutorial, you'll explore some of the coolest and most useful features in Python 3.10. You'll appreciate more user-friendly error messages, learn about how you can handle complicated data structures with structural pattern matching, and explore new enhancements to Python's … | Continue reading


@realpython.com | 2 years ago

The Walrus Operator: Python 3.8 Assignment Expressions

In this tutorial, you'll learn about assignment expressions and the walrus operator. The biggest change in Python 3.8 was the inclusion of the := operator, which you can use to assign variables in the middle of expressions. You'll see several examples of how to take advantage of … | Continue reading


@realpython.com | 2 years ago

Python's ChainMap: Manage Multiple Contexts Effectively

In this step-by-step tutorial, you'll learn about Python's ChainMap and how to use it to group multiple dictionaries together and manage them as a single one. ChainMap is handy when you need to manage multiple scopes and contexts and define access priorities. | Continue reading


@realpython.com | 2 years ago

Python's Collections: A Buffet of Specialized Data Types – Real Python

In this tutorial, you'll learn all about the series of specialized container data types in the collections module from the Python standard library. | Continue reading


@realpython.com | 2 years ago

Reverse Python Lists: Beyond .reverse() and reversed()

In this step-by-step tutorial, you'll learn about Python's tools and techniques to work with lists in reverse order. You'll also learn how to reverse your list by hand. | Continue reading


@realpython.com | 2 years ago

Detecting Deforestation with Python and Using GraphQL with Django and Vue

Are you looking for an in-depth data science project to practice your skills on? Perhaps you would like to add new tools to your Python web development projects instead? This week on the show, David Amos is back, and he's brought another batch of PyCoder's Weekly articles and pro … | Continue reading


@realpython.com | 2 years ago

Create Web Applications Using Only Python with Anvil

What if you could create an application and deploy it to the web with just Python? Wouldn't it be nice to skip the additional full-stack development steps of learning three different languages in addition to Python? That's the idea behind Anvil. This week on the show, we have Mer … | Continue reading


@realpython.com | 2 years ago

Primer on Python Decorators

In this introductory tutorial, we'll look at what Python decorators are and how to create and use them. | Continue reading


@realpython.com | 2 years ago

Embedded Python: Build a Game on the BBC Micro:Bit

In this tutorial, you'll learn about embedded development, an exciting area of programming that allows you to bring your code into the physical world. You'll learn about your options for writing embedded Python code and build a basic game using the BBC micro:bit. | Continue reading


@realpython.com | 2 years ago

Python Community Interview with Dane Hillard – Real Python

Dane Hillard is a Real Python contributor and author of the book Practices of the Python Pro. In this interview, we discuss a variety of topics, including code complexity, Python package maintenance, and popcorn. | Continue reading


@realpython.com | 3 years ago

Python AI: How to Build a Neural Network and Make Predictions

In this step-by-step tutorial, you'll build a neural network from scratch as an introduction to the world of artificial intelligence (AI) in Python. You'll learn how to train your neural network and make accurate predictions based on a given dataset. | Continue reading


@realpython.com | 3 years ago

Real Python's “Python Basics” is now available as a paperback book

Order your copy this week with a limited time discount for Early Supporters & RP Members | Continue reading


@realpython.com | 3 years ago

Brython: Python in the Browser

In this tutorial, you'll learn how to use Brython to run Python code in the browser. Although most front-end web applications are written in JavaScript, you can use Brython to access JavaScript libraries and APIs and deploy Python-based applications to the web. | Continue reading


@realpython.com | 3 years ago

Python Microservices with gRPC

In this tutorial, you'll learn how to build a robust and developer-friendly Python microservices infrastructure. You'll learn what microservices are and how you can implement them using gRPC and Kubernetes. You'll also explore advanced topics such as interceptors and integration … | Continue reading


@realpython.com | 3 years ago

C for Python Programmers

In this tutorial, you'll learn the basics of the C language, which is used in the source code for CPython, the most popular Python implementation. Learning C is important for Python programmers interested in contributing to CPython. | Continue reading


@realpython.com | 3 years ago

Bitwise Operators in Python

In this tutorial, you'll learn how to use Python's bitwise operators to manipulate individual bits of data at the most granular level. With the help of hands-on examples, you'll see how you can apply bitmasks and overload bitwise operators to control binary data in your code. | Continue reading


@realpython.com | 3 years ago

Real Python's Office Hours: Learn with Python Experts in Real Time

Come learn with Python experts at the Real Python Office Hours, a weekly video call that offers Real Python members the chance to get help with Python-related questions, meet new Pythonistas, learn about new and trending topics in the community, and get feedback and tips on Pytho … | Continue reading


@realpython.com | 3 years ago

Handling SQL Databases with PyQt: The Basics

In this step-by-step tutorial, you’ll learn how to use PyQt's built-in SQL support to create GUI applications that effectively manage SQL databases. | Continue reading


@realpython.com | 3 years ago

PyQt Layouts: Create Professional-Looking GUI Applications

In this step-by-step tutorial, you’ll learn how to use PyQt layouts to arrange and manage the graphical components on your GUI applications. With the help of PyQt's layout managers, you'll be able to create polished and professional GUIs with minimal effort. | Continue reading


@realpython.com | 3 years ago

Python Enumerate(): Simplify Looping with Counters

Once you learn about for loops in Python, you know that using an index to access items in a sequence isn't very Pythonic. So what do you do when you need that index value? In this tutorial, you'll learn all about Python's built-in enumerate(), where it's used, and how you can emu … | Continue reading


@realpython.com | 3 years ago

Python and PyQt: Creating Menus, Toolbars, and Status Bars – Real Python

In this step-by-step tutorial, you’ll learn how to create, customize, and use Python menus, toolbars, and status bars for creating GUI applications using PyQt. | Continue reading


@realpython.com | 3 years ago

Use Sentiment Analysis with Python to Classify Movie Reviews

In this tutorial, you'll learn about sentiment analysis and how it works in Python. You'll then build your own sentiment analysis classifier with spaCy that can predict whether a movie review is positive or negative. | Continue reading


@realpython.com | 3 years ago

Caching in Python Using the LRU Cache Strategy

Caching is an essential optimization technique. In this tutorial, you'll learn how to use Python's @lru_cache decorator to cache the results of your functions using the LRU cache strategy. This is a powerful technique you can use to leverage the power of caching in your implement … | Continue reading


@realpython.com | 3 years ago

Fourier Transforms with Scipy.fft: Python Signal Processing

In this tutorial, you'll learn how to use the Fourier transform, a powerful tool for analyzing signals with applications ranging from audio processing to image compression. You'll explore several different transforms provided by Python's scipy.fft module. | Continue reading


@realpython.com | 3 years ago

Get Started with Django Part 3: Django View Authorization

This tutorial covers how to restrict your web pages to users with different roles through Django view authorization. You'll learn about HttpRequest.user objects, view decorators that authenticate, and how to notify your users with the Django messages framework. | Continue reading


@realpython.com | 3 years ago

Python Modulo in Practice: How to Use the % Operator

In this tutorial, you'll learn about the Python modulo operator (%). You'll look at the mathematical concepts behind the modulo operation and how the modulo operator is used with Python's numeric types. You'll also see ways to use the modulo operator in your own code. | Continue reading


@realpython.com | 3 years ago

Level Up Your Skills with the Real Python Slack Community

In this guide, you'll learn how to get the most out of your Real Python membership using the community Slack. You'll learn some lesser-known features of Slack and see how to communicate your technical problems more effectively. | Continue reading


@realpython.com | 3 years ago

Podcast: Python Return Statement Best Practices and Working with the Map()

The Python return statement is such a fundamental part of writing functions. Is it possible you missed some best practices when writing your own return statements? This week on the show, David Amos returns with another batch of PyCoder’s Weekly articles and projects. We also talk … | Continue reading


@realpython.com | 3 years ago

Using ggplot in Python: Visualizing Data With plotnine

In this tutorial, you'll learn how to use ggplot in Python to build data visualizations with plotnine. You'll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way. | Continue reading


@realpython.com | 3 years ago

Pandas GroupBy: Your Guide to Grouping Data in Python – Real Python

In this tutorial, you'll learn how to work adeptly with the Pandas GroupBy facility while mastering ways to manipulate, transform, and summarize data. You'll work with real-world datasets and chain GroupBy methods together to get data in an output that suits your purpose. | Continue reading


@realpython.com | 3 years ago

Python Community Interview with Anthony Shaw

In this interview, we talk with Anthony Shaw, global senior vice president for talent transformation and innovation at NTT Ltd. We discuss a variety of topics, including Python security, advice for beginner developers, his love for the beach, and his new book, CPython Internals. | Continue reading


@realpython.com | 3 years ago

Python 3.9: Cool New Features for You to Try

In this tutorial, you'll explore some of the coolest and most useful features in the newly released Python 3.9. You'll learn how Python 3.9 makes it easier to work with time zones, dictionaries, decorators, and several other techniques that will make your code cleaner and more ef … | Continue reading


@realpython.com | 3 years ago

Python's Map(): Processing Iterables Without a Loop

In this step-by-step tutorial, you'll learn how Python's map() works and how to use it effectively in your programs. You'll also learn how to use list comprehension and generator expressions to replace map() in a Pythonic and efficient way. | Continue reading


@realpython.com | 3 years ago

The Python Return Statement: Usage and Best Practices

In this step-by-step tutorial, you'll learn how to use the Python return statement when writing functions. Additionally, you'll cover some good programming practices related to the use of return. With this knowledge, you'll be able to write readable, robust, and maintainable func … | Continue reading


@realpython.com | 3 years ago

Python Community Interview with David Amos

David Amos is the content technical lead at Real Python. He's also a co-curator of PyCoder's Weekly and the author of the Python Basics book. Join us as we talk about all those things as well as his love for LEGO and mathematics. | Continue reading


@realpython.com | 3 years ago

Numbers in Python

In this tutorial, you'll learn about numbers and basic math in Python. You'll explore integer, floating-point numbers, and complex numbers and see how perform calculations using Python's arithmetic operators, math functions, and number methods. | Continue reading


@realpython.com | 3 years ago

Video Subtitles and Transcripts Now Available on Real Python

Real Python video lessons now come with full subtitles and interactive, searchable transcripts. Read the announcement to see examples and learn more. | Continue reading


@realpython.com | 3 years ago

What Are Python Wheels and Why Should You Care?

In this tutorial, you'll learn what Python wheels are and why you should care as both a developer and end user of Python packages. You'll see how the wheel format has gained momentum over the last decade and how it has made the package installation process faster and more stable. | Continue reading


@realpython.com | 3 years ago