Build a Hangman Game With Python and PySimpleGUI

Wouldn’t it be cool to build a hangman game with a nice graphical user interface (GUI) in Python? Maybe you’ve built a text-based user interface version of hangman, and now you want to make an even more attractive game. For you as a Python programmer, building a GUI version of this game can be a rewarding challenge that can take you to the next skill level. Throughout this tutorial, you’ll build the hangman game in Python in a series of […]

Read more

How to Get the Current Time in Python

Getting the current time in Python is a nice starting point for many time-related operations. One very important use case is creating timestamps. In this tutorial, you’ll learn how to get, display, and format the current time with the datetime module. To effectively use the current time in your Python applications, you’ll add a few tools to your belt. For instance, you’ll learn how to read attributes of the current time, like the year, minutes, or seconds. To make the […]

Read more

Serialize Your Data With Python

Whether you’re a data scientist crunching big data in a distributed cluster, a back-end engineer building scalable microservices, or a front-end developer consuming web APIs, you should understand data serialization. In this comprehensive guide, you’ll move beyond XML and JSON to explore several data formats that you can use to serialize data in Python. You’ll explore them based on their use cases, learning about their distinct categories. By the end of this tutorial, you’ll have a deep understanding of the […]

Read more

Using Polars in a Pandas world

Polars is a dataframe-based library that can be faster, more memory efficient, and often simpler to use than Pandas. It’s also much newer, and correspondingly less popular. In November 2023: Polars had ~2.6 million downloads from PyPI. Pandas had ~140 million downloads! Because of Pandas’ popularity and decade and a half of availability, there are many third-party libraries with built-in support for Pandas, and others that specifically extend Pandas. Many plotting and visualization libraries will accept Pandas dataframes as an […]

Read more

Single and Double Underscores in Python Names

Python has a few important naming conventions that are based on using either a single or double underscore character (_). These conventions allow you to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more. Following and respecting these conventions allows you to write code that looks Pythonic and consistent in the eyes of other Python developers. This skill is especially useful when you’re writing code that’s intended for other developers […]

Read more

Advent of Code: Solving Puzzles With Python

Advent of Code is an online Advent calendar where you’ll find new programming puzzles offered each day from December 1 to 25. While you can solve the puzzles at any time, the excitement when new puzzles unlock is really something special. You can participate in Advent of Code in any programming language—including Python! With the help of this Code Conversation, you’ll be ready to start solving puzzles and earning your first gold stars. In this video course, you’ll learn: What […]

Read more

The Python Rich Package: Unleash the Power of Console Text

Python’s Rich package is a tool kit that helps you generate beautifully formatted and highlighted text in the console. More broadly, it allows you to build an attractive text-based user interface (TUI). Why would you choose a TUI over a graphical user interface, or GUI? Sometimes a text display feels more appropriate. Why use a full-blown GUI for a simple application, when an elegant text interface will do? It can be refreshing to work with plain text. Text works in […]

Read more

Two kinds of threads pools, and why you need both

When you’re doing large scale data processing with Python, threads are a good way to achieve parallelism. This is especially true if you’re doing numeric processing, where the global interpreter lock (GIL) is typically not an issue. And if you’re using threading, thread pools are a good way to make sure you don’t use too many resources. But how many threads should your thread pool have? And do you need just one thread pool, or more than one? In this […]

Read more

Build Conway’s Game of Life With Python

Wouldn’t it be cool to build a Python game that only requires initial user input and then seems to take on a mind of its own, creating mesmerizing patterns along the way? You can do exactly that with Conway’s Game of Life, which is about the evolution of cells in a life grid. Implementing the Game of Life algorithm is a good exercise with many interesting challenges that you’ll have to figure out. Specifically, you’ll need to build the life […]

Read more

Python Basics Exercises: Modules and Packages

In Python Basics: Modules and Packages, you learned how to build an application by putting related code into separate files called modules. You also used the import statement to use modules in another file. In this video course, you’ll practice: Creating your own modules Using modules in another file through the import statement Organizing several modules into a package with __init__.py Along the way, you’ll also get some insight into how to tackle coding challenges in general, which can be […]

Read more
1 84 85 86 87 88 913