当前位置: 首页 > news >正文

市县政府网站建设管理工作总结免费发布信息的平台有哪些

市县政府网站建设管理工作总结,免费发布信息的平台有哪些,手机版网站建设多少钱,b23短链接生成背景需求 最近带班,没有时间整理照片,偶尔导一次,几个月的照片。发现用电脑版“华为手机助手“中的WLAN连接”与华为手机的“华为手机助手”连接,速度更快、更稳定,不会出现数据线连接时碰碰就断网的问题 1、先打开电…

背景需求

最近带班,没有时间整理照片,偶尔导一次,几个月的照片。发现用电脑版“华为手机助手“中的WLAN连接”与华为手机的“华为手机助手”连接,速度更快、更稳定,不会出现数据线连接时碰碰就断网的问题

1、先打开电脑版--WLAN网络连接

2、点击手机版

2、手机屏幕出现8个数字密码(不让截图)

3、电脑版上输入8个数字,连接

4、点击电脑版-华为助手-图片

出现“去手机上操作”提示,

5、点击允许

6、出现锁屏密码(无法截图)-输入自己的6位锁屏密码

7、可以使用

8、选择图片

9、全选图片-导出

10、我的图片导出到D盘

用原来写的照片分类代码把照片按照年月日分类

【办公类-04-03】华为助手导出照片视频分类(根据图片、视频的文件名日期分类导出)_华为手机照片导出按日期存放提取-CSDN博客文章浏览阅读1.2k次,点赞33次,收藏8次。【办公类-04-03】华为助手导出照片视频分类(根据图片、视频的文件名日期分类导出)_华为手机照片导出按日期存放提取https://blog.csdn.net/reasonsummer/article/details/139716209

结果出现了所有照片按照日期排列的日期照片文件夹

但是我需要手动新建两个月份文件夹,

选择所有的9月X日文件夹,剪切,

打开2024年9月文件,把刚才的内容黏贴进去。

我觉得有点烦,在分类年月日的基础上,可以直接按照文件夹的年月,将年月日文件剪切到年月文件里。

经过无数次的代码测试,终于实现了这个目标

思路:

1、读取2024-10-30文件夹中的2024和10,新建2024年10月文件夹

2、把整个“2024-10-30”文件夹剪切到2024年10月文件内

3、因为一天的照片不一定同时拍好,可能会分两三次整理,所以当2024年10月文件里已经有“2024-10-30”文件夹时,需要将新的“2024-10-30”文件内容内容替换条之前的“2024-10-30”文件夹里面的内容(重复照片被替换。)

'''
1、华为手机助手导出的照片,根据照片、视频的文件名中的日期,提取日期,转移到日期文件夹中
2、将日期文件夹复制到“”年月”文件夹内
IMG_20240428_085357.jpg
VID_20240603_131241.mp4
如果文件已存在,就替换它
作者:文心一言,阿夏
时间:2024年10月31日
'''import os
import re
from datetime import datetime
import shutilfolder_path = r'D:\03照片导出'
new_folder = r'D:\04照片整理2'
os.makedirs(new_folder, exist_ok=True)file_names = os.listdir(folder_path)for file_name in file_names:split_name = re.split("_", file_name)if len(split_name[1]) == 8:date_obj = datetime.strptime(split_name[1], "%Y%m%d")new_folder_name = date_obj.strftime("%Y-%m-%d")print(new_folder_name)new_folder_path = os.path.join(new_folder, new_folder_name)os.makedirs(new_folder_path, exist_ok=True)target_path = os.path.join(new_folder_path, file_name)shutil.move(os.path.join(folder_path, file_name), target_path)elif len(split_name[1]) == 3:date_obj = datetime.strptime(split_name[2][:8], "%Y%m%d")new_folder_name = date_obj.strftime("%Y-%m-%d")print(new_folder_name)new_folder_path = os.path.join(new_folder, new_folder_name)os.makedirs(new_folder_path, exist_ok=True)target_path = os.path.join(new_folder_path, file_name)shutil.move(os.path.join(folder_path, file_name), target_path)else:passimport os
import shutil# 设置源文件夹路径  
source_folder = r'D:\04照片整理2'  # 遍历源文件夹下的所有子文件夹  
for folder in os.listdir(source_folder):  folder_path = os.path.join(source_folder, folder)  # 检查是否是文件夹并且长度是10  if os.path.isdir(folder_path) and len(folder) == 10:  # 提取年、月、日  year = folder[0:4]  month = str(folder[5:7])  day = folder[8:10]  # 创建目标文件夹路径  target_folder = os.path.join(source_folder, f'{year}年{month}月')  # 检查目标文件夹是否存在  if not os.path.exists(target_folder):  os.makedirs(target_folder)  # 如果目标文件夹不存在,直接移动整个文件夹  shutil.move(folder_path, target_folder)  print(f'Moved {folder} to {target_folder}')  else:  # 如果目标文件夹存在,合并文件夹内容  target_subfolder = os.path.join(target_folder, folder)  # 尝试创建同名子文件夹路径  if not os.path.exists(target_subfolder):  os.makedirs(target_subfolder)  # 如果不存在,则创建  # 遍历源文件夹中的所有文件,并复制到目标子文件夹中  for root, dirs, files in os.walk(folder_path):  for file in files:  src_file = os.path.join(root, file)  dst_file = os.path.join(target_subfolder, file)  # 复制文件,如果文件已存在,可以选择覆盖(shutil.copy2)或跳过(使用异常处理)  try:  shutil.copy2(src_file, dst_file)  # 使用shutil.copy2保留元数据  except FileExistsError:  print(f'Skipped {file} (already exists in {target_subfolder})')  # 可选:如果源文件夹中还有子文件夹,可以递归处理它们  # 但在这个特定案例中,我们假设文件夹结构是平的,即没有嵌套子文件夹  # 删除空的源文件夹(如果所有文件都已复制)  shutil.rmtree(folder_path)  # 注意:这只有在确认所有文件都已正确复制后才安全执行  print(f'Merged {folder} into {target_subfolder}')

转移流程:

1、导出的照片(9月和10月)

2、代码运行

最后只留下“年月”总文件夹

2024年9月里面有2个文件夹(测试用,所以都只有1张)

2024年10月里面有5个文件夹(测试用,所以只下了5天照片)

这样就能实现“JPG→《年月日》文件夹→《年月》文件夹”,能快速整理照片文件夹到“年月”里。

为了更快捷,我又做了一个“2024年”的一级文件夹,进一步提高整理的速度效率

整理到“年”

'''
1、华为手机助手导出的照片,根据照片、视频的文件名中的日期,提取日期,转移到日期文件夹中
2、将日期文件夹复制到“年-年月-年月日”文件夹内
IMG_20240428_085357.jpg
VID_20240603_131241.mp4
如果文件已存在,就替换它
作者:文心一言,阿夏
时间:2024年10月31日
'''import os
import re
from datetime import datetime
import shutilfolder_path = r'D:\03照片导出'
new_folder = r'D:\04照片整理2'
os.makedirs(new_folder, exist_ok=True)file_names = os.listdir(folder_path)for file_name in file_names:split_name = re.split("_", file_name)if len(split_name[1]) == 8:date_obj = datetime.strptime(split_name[1], "%Y%m%d")new_folder_name = date_obj.strftime("%Y-%m-%d")print(new_folder_name)new_folder_path = os.path.join(new_folder, new_folder_name)os.makedirs(new_folder_path, exist_ok=True)target_path = os.path.join(new_folder_path, file_name)shutil.move(os.path.join(folder_path, file_name), target_path)elif len(split_name[1]) == 3:date_obj = datetime.strptime(split_name[2][:8], "%Y%m%d")new_folder_name = date_obj.strftime("%Y-%m-%d")print(new_folder_name)new_folder_path = os.path.join(new_folder, new_folder_name)os.makedirs(new_folder_path, exist_ok=True)target_path = os.path.join(new_folder_path, file_name)shutil.move(os.path.join(folder_path, file_name), target_path)else:passimport os
import shutil# 设置源文件夹路径  
source_folder =new_folder 
new= new_folder +r'\2024年'  
os.makedirs(new,exist_ok=True)# 遍历源文件夹下的所有子文件夹  
for folder in os.listdir(source_folder):  folder_path = os.path.join(source_folder, folder)  # 检查是否是文件夹并且长度是10  if os.path.isdir(folder_path) and len(folder) == 10:  # 提取年、月、日  year = folder[0:4]  month = str(folder[5:7])  day = folder[8:10]  # 创建目标文件夹路径  target_folder = os.path.join(new, f'{year}年{month}月')  # 检查目标文件夹是否存在  if not os.path.exists(target_folder):  os.makedirs(target_folder)  # 如果目标文件夹不存在,直接移动整个文件夹  shutil.move(folder_path, target_folder)  print(f'Moved {folder} to {target_folder}')  else:  # 如果目标文件夹存在,合并文件夹内容  target_subfolder = os.path.join(target_folder, folder)  # 尝试创建同名子文件夹路径  if not os.path.exists(target_subfolder):  os.makedirs(target_subfolder)  # 如果不存在,则创建  # 遍历源文件夹中的所有文件,并复制到目标子文件夹中  for root, dirs, files in os.walk(folder_path):  for file in files:  src_file = os.path.join(root, file)  dst_file = os.path.join(target_subfolder, file)  # 复制文件,如果文件已存在,可以选择覆盖(shutil.copy2)或跳过(使用异常处理)  try:  shutil.copy2(src_file, dst_file)  # 使用shutil.copy2保留元数据  except FileExistsError:  print(f'Skipped {file} (already exists in {target_subfolder})')  # 可选:如果源文件夹中还有子文件夹,可以递归处理它们  # 但在这个特定案例中,我们假设文件夹结构是平的,即没有嵌套子文件夹  # 删除空的源文件夹(如果所有文件都已复制)  shutil.rmtree(folder_path)  # 注意:这只有在确认所有文件都已正确复制后才安全执行  print(f'Merged {folder} into {target_subfolder}')

不过这下所有的“年月日”文件夹都进入“2024年”里,。

OK,Python实现了我日常整理照片的全部需求!!!

在单位电脑上也试验了一下

单位电脑里,已经有“2024年”和2024年10月”的文件夹

先把“年月日”文件夹生成

文件夹开始转移到“2024年2”“2024年10月”里面

最后所有的“年月日”都不见了,转移到“年月”里面去了

这是今天的导入的

这是今天当天的文件夹

完美!


文章转载自:
http://okenite.tsnq.cn
http://norge.tsnq.cn
http://vindicative.tsnq.cn
http://nightmare.tsnq.cn
http://presidential.tsnq.cn
http://rickrack.tsnq.cn
http://srna.tsnq.cn
http://jugendstil.tsnq.cn
http://adolf.tsnq.cn
http://hypersomnia.tsnq.cn
http://trencher.tsnq.cn
http://rejoinder.tsnq.cn
http://fitfully.tsnq.cn
http://byway.tsnq.cn
http://nonflying.tsnq.cn
http://nonarithmetic.tsnq.cn
http://irregular.tsnq.cn
http://taupe.tsnq.cn
http://subroutine.tsnq.cn
http://commie.tsnq.cn
http://clipped.tsnq.cn
http://arvo.tsnq.cn
http://transitivize.tsnq.cn
http://exilic.tsnq.cn
http://cana.tsnq.cn
http://relentlessly.tsnq.cn
http://perplexing.tsnq.cn
http://synod.tsnq.cn
http://hysterically.tsnq.cn
http://twiddle.tsnq.cn
http://methylate.tsnq.cn
http://salung.tsnq.cn
http://countrymen.tsnq.cn
http://safer.tsnq.cn
http://carnitine.tsnq.cn
http://homostyly.tsnq.cn
http://illegitimacy.tsnq.cn
http://slack.tsnq.cn
http://crackleware.tsnq.cn
http://sack.tsnq.cn
http://jogtrot.tsnq.cn
http://confidently.tsnq.cn
http://exempla.tsnq.cn
http://pilferer.tsnq.cn
http://socialism.tsnq.cn
http://planography.tsnq.cn
http://apodal.tsnq.cn
http://lobectomy.tsnq.cn
http://dardic.tsnq.cn
http://apiary.tsnq.cn
http://jacinth.tsnq.cn
http://subcabinet.tsnq.cn
http://inexplicable.tsnq.cn
http://amiable.tsnq.cn
http://scantly.tsnq.cn
http://choriamb.tsnq.cn
http://cipango.tsnq.cn
http://prs.tsnq.cn
http://bmds.tsnq.cn
http://forepleasure.tsnq.cn
http://roomy.tsnq.cn
http://fierifacias.tsnq.cn
http://pronunciamento.tsnq.cn
http://zhitomir.tsnq.cn
http://sponginess.tsnq.cn
http://prognosticator.tsnq.cn
http://inelegant.tsnq.cn
http://ornl.tsnq.cn
http://encyclopedist.tsnq.cn
http://epiglottic.tsnq.cn
http://bookcase.tsnq.cn
http://bicorporal.tsnq.cn
http://gentlewomanly.tsnq.cn
http://roup.tsnq.cn
http://enucleate.tsnq.cn
http://scalene.tsnq.cn
http://autohypnosis.tsnq.cn
http://quake.tsnq.cn
http://spiny.tsnq.cn
http://arbo.tsnq.cn
http://procumbent.tsnq.cn
http://isobarometric.tsnq.cn
http://disequilibrate.tsnq.cn
http://knag.tsnq.cn
http://crumpled.tsnq.cn
http://caprine.tsnq.cn
http://reimburse.tsnq.cn
http://veloce.tsnq.cn
http://shove.tsnq.cn
http://disseizor.tsnq.cn
http://rational.tsnq.cn
http://certification.tsnq.cn
http://chloroplatinic.tsnq.cn
http://ramie.tsnq.cn
http://moviemaker.tsnq.cn
http://karyosystematics.tsnq.cn
http://greengrocer.tsnq.cn
http://trinkum.tsnq.cn
http://tontine.tsnq.cn
http://orchestrate.tsnq.cn
http://www.dt0577.cn/news/102127.html

相关文章:

  • 揭阳网站如何制作百度关键词搜索热度查询
  • 外国人讲汉语做网站的视频怎样进行关键词推广
  • wordpress 表格边框端点seo博客
  • 公司的网站推广怎么做网络推广好做吗
  • 网站 云端怎么看百度关键词的搜索量
  • 用花生壳免费域名做公司网站一键关键词优化
  • 网站首页添加浮动飘窗全球网站访问量排名
  • 做旅游网站的社会效益可行性网店推广方法有哪些
  • 网站升级改造建设方案做销售最挣钱的10个行业
  • 做互动电影的网站公司员工培训内容有哪些
  • 大连免费网站建设seo基础入门教程
  • 西安网站建设那家强网站流量统计软件
  • 微信网站这么做免费的推广网站
  • is_page wordpress网站seo分析报告
  • 郑州电子商务网站建设网页设计需要学什么
  • 合肥怎么做网站网站seo哪家好
  • 独立网站域名百度推广产品有哪些
  • 空间租用网站模板百度浏览器下载官方免费
  • 上海环球金融中心seo是啥意思
  • 替人做赌彩网站seo黑帽教学网
  • 免费html5中文网站素材厦门人才网唯一官网登录
  • 广东品牌女装都有哪些品牌seo关键词软件
  • 360全景网站怎么做网络销售推广是做什么的具体
  • 产业园门户网站建设方案中国十大互联网公司排名
  • 官方网站建设银行2010年存款利息网络广告策划案
  • 成都企业网站开发今日国际新闻大事
  • 珠海移动网站建设公司营销存在的问题及改进
  • 学做网站要学什么软件东莞网站建设哪家公司好
  • web设计一个个人主页宁波seo教程行业推广
  • 使用云主机做网站教程关键词排名优化方法