Python asyncio.gather() function (with examples)
Updated: Jul 26, 2023
Overview In Python, asyncio.gather() is a function that allows you to run multiple coroutines or awaitable objects concurrently and get the results once they are complete. It was added to Python in version 3.4, as part of the......
Python: Running a function periodically with asyncio
Updated: Jul 25, 2023
When developing applications with Python, there might be cases where you need to execute a function periodically, such as: Performing a recurring task, such as checking the status of a server, sending a notification, updating a......
Best open-source libraries to make HTTP requests in Python
Updated: Jul 20, 2023
This concise, straight-to-the-point article will walk you through a list of the best open-source libraries for making HTTP requests (GET, POST, PUT, DELETE, etc) in modern Python. httpx Overview: GitHub stars: 11k+ License:......
Python RuntimeWarning: Coroutine Was Never Awaited [Solved]
Updated: Jul 19, 2023
This concise article is about a common issue related to asynchronous programming in Python. The Problem When using async/await in Python, you might confront this error: RuntimeWarning: coroutine 'something' was never......
Python match/case statement (with examples)
Updated: Jul 18, 2023
What is the Point? The match/case statement in Python is used to implement switch-case like characteristics and if-else functionalities. It was introduced in Python 3.10. The match statement compares a given variable’s value to......
Python: Handling Exceptions with Try/Except/Else/Finally
Updated: Jul 15, 2023
What is the Point? In Python, you can handle exceptions using the try/except/else/finally statements. These statements provide a way to catch and handle exceptions, execute specific code when no exceptions occur, and perform cleanup......
Making use of the “with” statement in Python (4 examples)
Updated: Jul 15, 2023
What is the point? The with statement in Python provides a convenient way to manage resources, such as files, databases, or network connections, by ensuring that they are properly opened and closed. It simplifies the process of......
Shorthand syntax for if/else in Python (conditional expression)
Updated: Jul 15, 2023
In Python, the shorthand syntax for an if/else statement is called a conditional expression or a ternary operator. It allows you to write a concise one-liner to evaluate a condition and choose one of two values based on the result of that......
Python While Loops: Tutorial & Examples
Updated: Jul 15, 2023
What is the Point? The while loop in Python is a type of loop that executes a block of code repeatedly as long as a given condition is True. Unlike the for loop, which iterates over a fixed sequence of values, the while loop can run......
Python Function: Keyword & Positional Arguments
Updated: Jul 15, 2023
This concise article is about positional and keyword arguments in Python. Positional arguments Positional arguments are arguments that are passed to a function by their position or order in the function call. They are assigned to......
Python: How to Define and Call Asynchronous Functions
Updated: Jul 13, 2023
This concise and straight-to-the-point article shows you how to define and call an asynchronous function (async function) in Python (you’ll need Python 3.5 or higher). Defining an Async Function In order to define an......
Python Generators: Tutorial & Examples
Updated: Jul 13, 2023
Overview Generators in Python are a way of creating iterators that can produce a sequence of values lazily without storing them all in memory at once. Their purpose is to simplify the creation of iterators and to enable efficient......