Python tutorials

Build a Flashcards App With Django

Flashcards are a great tool when you want to memorize a new topic or learn a new language. You write a question on the front of the card and the answer on the back of the card. Then you can test your memory by going through the flashcards. The more often you show a card to yourself, the better your chances of memorizing its content. With Django, you can build your own flashcards app. By following this tutorial, you’ll build […]

Read more

NumPy’s max() and maximum(): Find Extreme Values in Arrays

You’ve now seen examples of all the basic use cases for NumPy’s max() and maximum(), plus a few related functions. Now you’ll investigate some of the more obscure optional parameters to these functions and find out when they can be useful. Reusing Memory When you call a function in Python, a value or object is returned. You can use that result immediately by printing it or writing it to disk, or by feeding it directly into another function as an […]

Read more

SQLite and SQLAlchemy in Python: Moving Your Data Beyond Flat Files

All programs process data in one form or another, and many need to be able to save and retrieve that data from one invocation to the next. Python, SQLite, and SQLAlchemy give your programs database functionality, allowing you to store data in a single file without the need for a database server. You can achieve similar results using flat files in any number of formats, including CSV, JSON, XML, and even custom formats. Flat files are often human-readable text files—though […]

Read more

Python and TOML: New Best Friends

TOML—Tom’s Obvious Minimal Language—is a reasonably new configuration file format that the Python community has embraced over the last couple of years. TOML plays an essential part in the Python ecosystem. Many of your favorite tools rely on TOML for configuration, and you’ll use pyproject.toml when you build and distribute your own packages. In this tutorial, you’ll learn more about TOML and how you can use it. In particular, you’ll: A new module for TOML parsing is being added to […]

Read more

Python News: What’s New From June 2022

June 2022 brought a flurry of exciting news for the Python community! The PSF received funding for a new role focused on security, and held elections for four seats on the board of directors. Results from two important developer surveys were published, and new versions of both Python and some popular packages saw the light of day. PEP 691 got accepted, extending the Simple API for Python packaging indexes. With the Python 3.12 change page live, you can now start […]

Read more

Using the Python and Operator

Python has three Boolean operators, or logical operators: and, or, and not. You can use them to check if certain conditions are met before deciding the execution path your programs will follow. In this video course, you’ll learn about the and operator and how to use it in your code. In this video course, you’ll learn how to: Understand the logic behind Python’s and operator Build and understand Boolean and non-Boolean expressions that use the and operator Use the and […]

Read more

Python 3.11 Preview: TOML and tomllib

Python 3.11 is getting closer to its final release, which will happen in October 2022. The new version is currently going through beta testing, and you can install it yourself to preview and test some of the new features, including support for reading TOML with the new tomllib module. TOML is a configuration file format that’s getting more and more popular in the Python ecosystem. This is driven by the adoption of pyproject.toml as the central configuration file in Python […]

Read more

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

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
1 92 93 94 95 96 185