Python Stacks, Queues, and Priority Queues in Practice

Queues are the backbone of numerous algorithms found in games, artificial intelligence, satellite navigation, and task scheduling. They’re among the top abstract data types that computer science students learn early in their education. At the same time, software engineers often leverage higher-level message queues to achieve better scalability of a microservice architecture. Plus, using queues in Python is simply fun! Python provides a few built-in flavors of queues that you’ll see in action in this tutorial. You’re also going to […]

Read more

Introducing the Microsoft Climate Research Initiative

Addressing and mitigating the effects of climate change requires a collective effort, bringing our strengths to bear across industry, government, academia, and civil society. As we continue to explore the role of technology to advance the art of the possible, we are launching the Microsoft Climate Research Initiative (MCRI). This community of multi-disciplinary researchers is working together to accelerate cutting-edge research and transformative innovation in climate science and technology. MCRI enables us to bring  

Read more

Building a Site Connectivity Checker

Building a site connectivity checker in Python is an interesting project to level up your skills. With this project, you’ll integrate knowledge related to handling HTTP requests, creating command-line interfaces (CLI), and organizing your application’s code using common Python project layout practices. By building this project, you’ll learn how Python’s asynchronous features can help you deal with multiple HTTP requests efficiently. In this video course, you’ll learn how to: Create command-line interfaces (CLI) using Python’s argparse Check if a website […]

Read more

Build a Tic-Tac-Toe Game With Python and Tkinter

Playing computer games is a great way to unwind or challenge yourself. Some people even do it professionally. It’s also fun and educational to build your own computer games. In this tutorial, you’ll build a classic tic-tac-toe game using Python and Tkinter. With this project, you’ll go through the thought processes required for creating your own game. You’ll also learn how to integrate your diverse programming skills and knowledge to develop a functional and fun computer game. In this tutorial, […]

Read more

Effective Python Testing With Pytest

Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Testing Your Code With pytest Testing your code brings a wide variety of benefits. It increases your confidence that the code behaves as you expect and ensures that changes to your code won’t cause regressions. Writing and maintaining tests is hard work, so you should leverage all the tools at your disposal to make […]

Read more

Why new Macs break your Docker build, and how to fix it

One of the promises of Docker is reproducibility: you can build an image on a different machine, and assuming you’ve done the appropriate setup, get the same result. So it can be a little confusing when you try to build your Python-based Dockerfile on a new Mac, and everything starts failing. What used to work before—on an older Mac, or on a Linux machine—fails in completely unexpected ways. The problem is that the promise of reproducibility relies on certain invariants […]

Read more

Python mmap: Doing File I/O With Memory Mapping

The Zen of Python has a lot of wisdom to offer. One especially useful idea is that “There should be one—and preferably only one—obvious way to do it.” Yet there are multiple ways to do most things in Python, and often for good reason. For example, there are multiple ways to read a file in Python, including the rarely used mmap module. Python’s mmap provides memory-mapped file input and output (I/O). It allows you to take advantage of lower-level operating […]

Read more

How Can You Emulate Do-While Loops in Python?

If you came to Python from a language like C, C++, Java, or JavaScript, then you may be missing their do-while loop construct. A do-while loop is a common control flow statement that executes its code block at least once, regardless of whether the loop condition is true or false. This behavior relies on the fact that the loop condition is evaluated at the end of each iteration. So, the first iteration always runs. One of the most common use […]

Read more
1 209 210 211 212 213 985