部分内容源自网络,侵删,联系请看关于或声明。

命名后上传至阿里云盘

该Python脚本实现了文件重命名、移动和上传至阿里云盘的功能。首先,根据指定的前缀和扩展名对目录下的文件进行重命名,命名规则为前缀加三位数字后缀。接着,将重命名后的文件移动到指定目录。最后,脚本将文件上传至阿里云盘的指定文件夹,确保目录结构完整。整个过程通过读取和更新JSON文件中的计数器值来管理文件命名顺序。

thumbnail of the cover of the post

Centos7.6Yum失败

背景 本地虚拟机安装docker失败,不,应该说是yum安装软件都失败,前几次安装也失败,没记录,时间长了就忘了咋解决的,这次就记录一下。 [root@blog ~]# yum install -y vim 已加载插件:fastestmirror Loading mirror speeds fro

thumbnail of the cover of the post

文件命名-计数版

代码 import os import json record_file = 'rename_record.json' def get_current_count(prefix): """ 获取当前计数器的值。 该函数用于读取记录文件中特定前缀的计数器值,如果不存在

thumbnail of the cover of the post

批量命名-递增版

前言 为了规范我的博客文件而生,适用于各种文件,没有做文件类型校验,先将同一类型的放一起再进行重命名。 建议复制文件后,使用复制后的文件进行重命名。 改进版看文件命名-计数版,使用json,记录不同类型前缀,可限制文件类型。 代码 import os import pandas as pd d

thumbnail of the cover of the post

一键打包

前置 啊,懒得写…… 代码 import os import shutil import zipfile def backup_and_delete(base_path, objects_to_delete, backup_path, zip_path): """ 备份指定目录并

thumbnail of the cover of the post