my script:
from os import walk, path, rename
def rename(source, dest):
for root, sub, files in walk(source):
for file in files:
if file.endswith('.mp4'):
nbase = file.split('.mp4')[0]
newname = nbase[0:len(nbase) - 12] + '.mp4'
nsource = path.join(root, file)
rdest = path.join(dest,newname)
rename(nsource,rdest)
s = '/Users/ja/Desktop/t'
d = '/Users/ja/Desktop/u'
rename(s,d)
This script, line for line, will run in ipython, rename and relocate a file without issue. when scripted in sublimetext, or in textedit, and saved, it throws no errors, but does nothing. I am on macOS mojave.