Python Standard Library Tutorials


Explore Python's standard library, modules such as os, json, re, ftplib, imaplib, threading, pickle, socket, random, secrets and many more.

How to Make a Chat Application in Python
How to Make a Chat Application in Python

Learn how to build a simple chat room application that accepts multiple connected clients using built-in's sockets and threading libraries in Python.

Logging in Python
Logging in Python

Learn how to use Python's built-in logging module to log your Python applications, changing default format, level, and learning in a concrete example, as well as using logging handlers.

How to Use Regular Expressions in Python
How to Use Regular Expressions in Python

Learn how to use Python's built-in re module to use several string matching techniques using functions like match, search, finditer and sub.

How to Work with JSON Files in Python
How to Work with JSON Files in Python

Learn how to save (serialize) and load (deserialize) JSON files in Python using the built-in json module.

How to Download and Upload Files in FTP Server using Python
How to Download and Upload Files in FTP Server using Python

Learn how to use Python's built-in ftplib module to download and upload files in a FTP server using RETR and STOR commands respectively.

How to Read Emails in Python
How to Read Emails in Python

Learn how you can use IMAP protocol to extract, parse and read emails from outlook, aol, office 365 and other email providers as well as downloading attachments using imaplib module in Python.

How to List all Files and Directories in FTP Server using Python
How to List all Files and Directories in FTP Server using Python

Listing all files and directories in an FTP server using LIST, NLST and MLSD FTP commands in Python using the built-in ftplib module.

How to Use Threads for IO Tasks in Python
How to Use Threads for IO Tasks in Python

Using different methods such as thread pool executor or threading module to create and handle threads for speeding up I/O bound tasks in Python.

How to Get the Size of Directories in Python
How to Get the Size of Directories in Python

Calculating the size of a directory in bytes in Python and plotting a pie using matplotlib to see which subdirectory takes most size.

How to Generate Random Data in Python
How to Generate Random Data in Python

Generating random integers, floating point numbers, strings and bytes using random, os and secrets built-in modules in Python.

How to Use Hashing Algorithms in Python using hashlib
How to Use Hashing Algorithms in Python using hashlib

Using different hashing algorithms such as SHA-2, SHA-3 and BLAKE2 in Python using hashlib built-in module for data integrity.

How to Handle Files in Python
How to Handle Files in Python

Learn how to work with files in Python using os and shutil modules including creating, renaming, moving, removing files and directories, listing all current files and directories and more.

How to Send Emails in Python
How to Send Emails in Python

Learn how to use Python's standard library smtplib and email modules to connect to any SMTP server and send emails in Python automatically.

How to Manipulate IP Addresses in Python using ipaddress Module
How to Manipulate IP Addresses in Python using ipaddress Module

Using ipaddress standard Python library to manipulate IPv4 and IPv6 addresses, networks, subnets and more.

How to Use Pickle for Object Serialization in Python
How to Use Pickle for Object Serialization in Python

Using Python standard library pickle module to save (pickle) and load (unpickle) any type of object in Python.

How to Compress and Decompress Files in Python
How to Compress and Decompress Files in Python

Learn how to compress and decompress files, folders and symbolic links in Python using gzip compression in tarfile built-in module.