コード例 #1
0
ファイル: freq.py プロジェクト: vtmer/freshman-weixin
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)
コード例 #2
0
ファイル: keywords.py プロジェクト: vtmer/freshman-weixin
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'))