📄️ File Handling
File handling is a fundamental skill in Python, allowing you to create, read, write, and manage files programmatically. This tutorial covers the basics of file operations, including working with text files, understanding file paths, and performing various operations on files.
📄️ Reading Files
This tutorial explains how to read files in Python using the with statement and the open() function. By using with, you ensure that files are properly closed after their use, even if exceptions occur during execution. This approach is efficient, safe, and simplifies file handling in Python.
📄️ Writing & Creating Files in Python
Manipulating files in Python is a key skill for working with text files. This tutorial explores how to write, create, and edit files effectively using different file operation modes.
📄️ Deleting Files
Deleting files is a common operation in Python when managing file systems. Python provides built-in methods in the os and pathlib modules to delete files efficiently. This tutorial will cover how to delete files and handle exceptions to ensure safety and error handling.
📄️ JSON
📄️ Handling JSON
📄️ Caching JSON
In this tutorial, we'll learn how to create a JSON cache for API data in Python. This will help us avoid making repetitive requests to the API by storing the fetched data locally. We'll be using the requests library for making HTTP requests and the json module for handling JSON data.
📄️ Glob Module
The glob module in Python is a powerful tool for finding file paths matching specific patterns. It uses Unix shell-like rules for pattern matching, making it an efficient way to search for files and directories.
📄️ Pickling
Pickling is the process of serializing and deserializing Python objects. Serialization involves converting a Python object into a byte stream, which can then be stored or transmitted. Deserialization, or unpickling, reverses this process, allowing you to recreate the original Python object. Pickling is especially useful for saving the state of complex objects or data structures. However, caution is required, as improper usage can pose security risks.
📄️ YAML
YAML (YAML Ain't Markup Language) is a human-readable data serialization format. It is widely used for configuration files, data exchange between applications, and as a language-independent alternative to XML or JSON. YAML's simple and readable syntax makes it popular among developers.
📄️ TOML
TOML (Tom's Obvious, Minimal Language) is a human-readable data serialization format designed to be easy to read and write. It is commonly used for configuration files due to its simplicity and support for nested structures. TOML provides a clear structure for representing key-value pairs, arrays, and tables, making it a popular choice among developers.