Python

Python: 7 Ways to Find the Length of a String

Updated: May 24, 2023 By: Khue

This concise, example-based article will walk you through several different ways to find the length (the number of characters) of a given string in Python. Each approach will…

Python: 3 ways to remove empty lines from a string

Updated: May 20, 2023 By: Frienzied Flame

A multiple-line string might contain one or many empty lines. Empty lines refer to lines in a text or string that contain no visible content or characters. They…

Python: How to unescape HTML entities in a string

Updated: May 20, 2023 By: Frienzied Flame

Overview HTML entities are special characters that are used to represent characters that have special meaning in HTML or that are not part of the character set. They…

Python: 5 ways to remove HTML tags from a string

Updated: May 20, 2023 By: Frienzied Flame

This concise, example-based article will walk you through some different approaches to stripping HTML tags from a given string in Python (to get plain text). The raw HTML…

Python: Extract and download all images from a web page

Updated: May 20, 2023 By: Frienzied Flame

This example-based article walks you through 2 different ways to programmatically extract and download all images from a web page with Python. The first approach use requests and…

Python: 2 Ways to Extract Plain Text from a Webpage

Updated: May 19, 2023 By: Frienzied Flame

The raw HTML data of a webpage includes many things, from HTML tags, images, JavaScript codes, etc. Sometimes, you just need plain text for data analytics, machine learning,…

Python: Checking System RAM/CPU/Disk Usage

Updated: May 19, 2023 By: Khue

This succinct, practical article shows you how to programmatically check RAM (memory), CPU, and disk usage in Python. You can get the job done painlessly by using a…

Python Generic Types: Tutorial & Examples

Updated: March 4, 2023 By: Goodman

This concise article is about generic types in Python. Overview Generic types allow us to define classes, functions, or methods that can work with different data types without…

Python: Defining Functions with Type Hints

Updated: March 4, 2023 By: Khue

This concise, example-based article shows you how to define functions with type hints in Python. Overview Python 3.5 introduced Type Hints which allows you to specify the data…

Python Data Types Cheat Sheet

Updated: March 4, 2023 By: Wolf

A succinct, comprehensive cheat sheet for Python data types. You can use it for quick lookup during your work. Type Description Example int integer values 123, -120, 0…

1 59 60 61 62 63 64