Posts for: #Python

How to Join Strings in Python

In this tutorial, you’ll learn how to use Python’s built-in .join() method to combine string elements from an iterable into a single string with a specified separator. You’ll also learn about common pitfalls, and how CPython makes .join() work efficiently.

[Read more]

How to Split a String in Python

This tutorial will help you master Python string splitting. You’ll learn to use .split(), .splitlines(), and re.split() to effectively handle whitespace, custom delimiters, and multiline text, which will level up your data parsing skills.

[Read more]

How to Flush the Output of the Python Print Function

In this tutorial, you’ll learn how to flush the output of Python’s print function. You’ll explore output stream buffering in Python using code examples and learn that output streams are block-buffered by default, and that print() with its default arguments executes line-buffered when interactive.

[Read more]

Python News Roundup: December 2024

This month brings exciting updates, including improvements to template strings in PEP 750 and the release of Python 3.14.0a2. There are new features to explore in many third-party libraries, such as Pydantic. Also, PyCon’s call for proposals deadline is near and the popular Advent of Code is back.

[Read more]

Asynchronous Tasks With Django and Celery

In this tutorial, you’ll learn how to integrate Celery and Django using Redis as a message broker. You’ll refactor the synchronous email sending functionality of an existing Django app into an asynchronous task that you’ll run with Celery instead.

[Read more]

Basic Input and Output in Python

In this tutorial, you’ll learn how to take user input from the keyboard with the input() function and display output to the console with the print() function. You’ll also use readline to improve the user experience when collecting input and to effectively format output.

[Read more]

Beautiful Soup: Build a Web Scraper With Python

In this tutorial, you’ll walk through the main steps of the web scraping process. You’ll learn how to write a script that uses Python’s Requests library to scrape data from a website. You’ll also use Beautiful Soup to extract the specific pieces of information you’re interested in.

[Read more]