Python Basics Exercises: Reading and Writing Files

Files play a key role in computing, as they store and transfer data. You likely come across numerous files on a daily basis. In Python Basics: Reading and Writing Files, you dove into the world of file manipulation using Python. In this video course, you’ll practice: Differentiating between text and binary files Using character encodings and line endings Manipulating file objects in Python Reading and writing character data with different file modes Using open(), Path.open(), and the with statement Leveraging […]

Read more

Enhance Your Flask Web Project With a Database

Adding a database to your Flask project comes with many advantages. By connecting a database, you’ll be able to store user information, monitor user interactions, and maintain dynamic site content. By the end of this tutorial, you’ll have a robust understanding of how to connect your Flask app to a database and how to leverage this connection to expand your project’s capabilities. Prerequisites You’ll gain the most value from this tutorial if you’ve already created one or more Flask web […]

Read more

Build a Scalable Flask Web Project From Scratch

Flask is a powerful and flexible micro web framework for Python, ideal for both small and large web projects. It provides a straightforward way to get a web application up and running, with all the features that you need to get started. Over the course of this tutorial, you’ll explore the process of creating a boilerplate for a Flask web project. This boilerplate will serve as a great starting point for any scalable Flask web app that you wish to […]

Read more

Python Basics Exercises: Strings and String Methods

In Python Basics: Strings and String Methods, you used strings for text data in Python. You also learned how to manipulate strings with string methods. For example, you changed strings from lowercase to uppercase, removed whitespace from the beginning or end of a string, and replaced parts of a string with different text. In this video course, you’ll practice: Manipulating strings with string methods Working with user input Dealing with strings of numbers Formatting strings for printing This video course […]

Read more

Python News: What’s New From November 2023

November brought exciting news to the Python community, from PyPI’s first security audit to a new version of PyScript! The month also gave Python developers like you ample opportunities to get involved in the ecosystem through the annual Python Developers Survey and the PyCon US call for proposals. Development has also continued on Python 3.13 and Pydantic. Get ready to explore the recent highlights! PyPI Completes First Security Audit With the support of the Open Technology Fund (OTF), the Python […]

Read more

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
1 78 79 80 81 82 908