处理重复文件

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.


图片批量命名+webp转换

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.


图片批量转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.


批量命名

文章介绍了使用Python批量重命名图片文件的方法,提供了两种实现方式:一种是为文件加前缀,另一种是不加前缀直接按数字升序重命名。Python语法易读,适合自动化处理文件任务。


Python学习笔记

Python中字面量包括整型、浮点型、字符串、布尔型和空值。变量命名需遵循特定规则,类型自动确定,支持多重赋值与数据类型转换。标识符区分大小写,不能使用数字开头且避免与保留关键字相同。