def write_lastlines_file(lastlines_dirpath, path, data):
 underscored = path.replace('/', '_')
 dest_path = os.path.join(lastlines_dirpath, underscored)
 open(dest_path, 'w').write(data)
 return dest_path

def write_lastlines_file ( lastlines_dirpath , path , data ) : underscored = path . replace ( '/' , '_' ) dest_path = os . path . join ( lastlines_dirpath , underscored ) open ( dest_path , 'w' ) . write ( data ) return dest_path
write data to lastlines file for path .