Guest User

Untitled

a guest
Jul 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import os
  2.  
  3. root = "F:\\Camera_Calibration\\A7S2\\16000"
  4.  
  5. for dirPath, _, files in os.walk(root):
  6. for f in files:
  7. # print (os.path.join(dirPath, f)[-22:])
  8. print (f[9:-4])
  9. try:
  10. os.mkdir(os.path.join(root, f[9: -4]))
  11. except:
  12. pass
  13. os.rename(os.path.join(dirPath, f), os.path.join(root, f[9:-4], f))
Add Comment
Please, Sign In to add comment