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