前言
把一些我常用的小操作记录下来,省的用一次上网查一次改一次 orz
正文
输出一段 markdown 图片代码
1 2
| for i in range(5): print(' + '.png)\n')
|
1 2 3 4 5 6 7 8 9 10
| 




|
批量重命名
1 2 3 4 5 6
| import os
path = r'd:\Pictures\QQplayerPic' label = 'E5' for index, file in enumerate(os.listdir(path)): os.rename(os.path.join(path,file),os.path.join(path,label + '.' + str(index + 1))+".png")
|
批量重命名,并将重命名的文件录入剪贴板
1 2 3 4 5 6 7 8 9 10 11
| import os import pyperclip
path = r'd:\Pictures\QQplayerPic' label = 'E5' copy_text = "" for index, file in enumerate(os.listdir(path)): copy_text += ' + '.png)\n\n' os.rename(os.path.join(path,file),os.path.join(path,label + '.' + str(index + 1))+".png") pyperclip.copy(copy_text) print(copy_text)
|
1 2 3 4 5 6 7 8 9 10
| 




|