Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- root = "F:\\Camera_Calibration\\A7S2\\16000"
- for dirPath, _, files in os.walk(root):
- for f in files:
- # print (os.path.join(dirPath, f)[-22:])
- print (f[9:-4])
- try:
- os.mkdir(os.path.join(root, f[9: -4]))
- except:
- pass
- os.rename(os.path.join(dirPath, f), os.path.join(root, f[9:-4], f))
Add Comment
Please, Sign In to add comment