This Python script backs up a specified directory, deletes certain files or directories, and compresses the backup into a ZIP file. It defines functions and paths for the original directory, objects to delete, backup directory, and zip file path, then executes the backup and deletion.
This Python function generates formatted markdown strings for inserting images with sequential names. It accepts a prefix, path, and a termination number (1-999) as inputs. The function formats the image filenames and paths, suitable for批量插入Markdown图片。
This Python script renames and reorders image files in a specified directory based on their modification time. It supports both prefix-less and prefix-based renaming. The script copies the files to an output directory with new names sequentially from 001.
This article provides a guide for packaging Python scripts into standalone executable files using PyInstaller. It covers how to install the tool, create a script with functions to detect duplicate files, and package the script into a .exe file. The process is ideal for distributing and running Python applications on Windows platforms.
This Python script finds and handles duplicate files in a given directory. It calculates file hashes to identify duplicates, then deletes or moves them based on specified actions. The script walks through the directory, checks file hashes, and processes duplicates accordingly.
This Python script renames and converts PDF files in a directory to WebP format. It first renames images with a prefix and number, then converts them to WebP. If the new name already exists, it skips the file. The script also supports renaming images without a prefix and converting them to WebP.
The article discusses the process of converting images to WebP format using Python, addressing the limitations of online tools such as speed and convenience. It provides a Python script that bulk converts images from PNG, JPG, and JPEG to WebP format, suitable for high-quality image display. The code creates an output directory, iterates through source images, and saves each file as a WebP, ensuring efficient and user-friendly conversion.