Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import socket
  2. import os, sys
  3. import subprocess
  4. import datetime
  5. import time
  6. from subprocess import call
  7.  
  8. def rename_each_file(x):
  9. modified_time = time.strftime("%m/%d/%Y %H:%M:%S %p",time.localtime(os.path.getmtime(entry)))
  10. modified_month = modified_time[0:2]
  11. modified_day = modified_time[3:5]
  12. modified_year = modified_time[6:10]
  13. modifed_hour = modified_time[11:13]
  14. modified_minute = modified_time[14:16]
  15. modified_second = modified_time[17:19]
  16. old_file_name = entry
  17. new_file_name = (modified_year+modified_month+modified_day+"_"+modifed_hour+modified_minute+modified_second+".MP4")
  18. print ( "Changing ", old_file_name, "to ", new_file_name )
  19. call(["ren", old_file_name, new_file_name ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement