def concat(): content = [] for name in list_raw_files(RAW): with open(name) as f: content.append(parse(f.read())['content']) return '\n'.join(content)
def main(): for files in list_raw_files(RAW): with open(files) as f: post = parse(f.read()) with open(os.path.join(DEST, os.path.basename(files)), 'w') as d: d.write('\n'.join(extract(post)).encode('utf-8'))