def make_temp_path(path, new_ext=None):
 (root, ext) = os.path.splitext(path)
 if (new_ext is None):
  new_ext = ext
 temp_path = ((root + TEMP_EXTENSION) + new_ext)
 return temp_path

def make_temp_path ( path , new_ext = None ) : ( root , ext ) = os . path . splitext ( path ) if ( new_ext is None ) : new_ext = ext temp_path = ( ( root + TEMP_EXTENSION ) + new_ext ) return temp_path
arguments: new_ext: the new file extension .