Python tutorials

Python News: What’s New From April 2022

April 2022 saw the return of the PyCon US conference in person in Salt Lake City. During the conference, Python developers met for the annual Language Summit, and Anaconda announced PyScript, a way to write Python directly inside HTML. Earlier in the month, the Python Software Foundation (PSF) welcomed its new executive director. Read on to dive into the biggest Python news from the past month! PyScript: Python in Your Browser During his keynote at PyCon US, Anaconda CEO Peter […]

Read more

Top Python Game Engines

Like many people, maybe you wanted to write video games when you first learned to code. But were those games like the games you played? Maybe there was no Python when you started, no Python games available for you to study, and no game engines to speak of. With no real guidance or framework to assist you, the advanced graphics and sound that you experienced in other games may have remained out of reach. Now, there’s Python, and a host […]

Read more

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 it as painless as possible. pytest is one of the best tools you can use to boost your testing productivity. In this video course, you’ll learn: What benefits pytest offers How […]

Read more

Python’s min() and max(): Find Smallest and Largest Values

Python’s built-in min() and max() functions come in handy when you need to find the smallest and largest values in an iterable or in a series of regular arguments. Even though these might seem like fairly basic computations, they turn out to have many interesting use cases in real-world programing. You’ll try out some of those use cases here. In this tutorial, you’ll learn how to: Use Python’s min() and max() to find smallest and largest values in your data […]

Read more

Real Python at PyCon US 2022

PyCon US is back as an in-person conference. PyCon US 2022 is happening in Salt Lake City April 29 to May 1, and Real Python is there as well. Come join us at our booth and at the open space on Saturday. In this article, you’ll learn where you can find Real Python at PyCon in Salt Lake City, and get to know what some of our team members are excited about at the conference. Meet Real Python at PyCon […]

Read more

When Python can’t thread: a deep-dive into the GIL’s impact

Most computers these days come with multiple cores, allowing multiple threads to run computations in parallel. And even without multiple cores, you can have concurrency, for example one thread waiting on disk while another runs code on the CPU. The ability to use parallelism can be critical to scaling your application—or making your data processing finish faster. Unfortunately, in many cases Python can only run one thread at a time, due to what’s know as the Global Interpreter Lock (“GIL”). […]

Read more

Why Is It Important to Close Files in Python?

At some point in your Python coding journey, you learn that you should use a context manager to open files. Python context managers make it easy to close your files once you’re done with them: with open(“hello.txt”, mode=”w”) as file: file.write(“Hello, World!”) The with statement initiates a context manager. In this example, the context manager opens the file hello.txt and manages the file resource as long as the context is active. In general, all the code in the indented block […]

Read more

Combining Data in Pandas With merge(), .join(), and concat()

The Series and DataFrame objects in pandas are powerful tools for exploring and analyzing data. Part of their power comes from a multifaceted approach to combining separate datasets. With pandas, you can merge, join, and concatenate your datasets, allowing you to unify and better understand your data as you analyze it. In this tutorial, you’ll learn how and when to combine your data in pandas with: merge() for combining data on common columns or indices .join() for combining data on […]

Read more

Python 3.11 Preview: Task and Exception Groups

Python 3.11 will be released in October 2022. Even though October is still months away, you can already preview some of the upcoming features, including the new task and exception groups that Python 3.11 has to offer. Task groups let you organize your asynchronous code better, while exception groups can collect several errors happening at the same time and let you handle them in a straightforward manner. There are many other improvements and features coming in Python 3.11. Check out […]

Read more

Building a Django User Management System

If you’re building your own Django applications, you might decide to extend them with user accounts. In this video course, you’ll learn how to work with Django user management and add it to your program. By the end of this video course, you’ll be able to: Create an application where users can register, log in, and reset and change passwords on their own Edit the default Django templates responsible for user management Send password reset emails to actual email addresses […]

Read more
1 92 93 94 95 96 181