uses os.path.join, .basename, .splitext, etc. instead of str.join .split