kikukawa's diary

都内で活動するシステムエンジニアが書いてます。 興味を持った技術やハマったポイント、自分用メモをつけてます。 最近はweb中心

2014-11-19から1日間の記事一覧

pythonでファイル読み込み

自分用メモ 全部読みたいとき def read_file(filepath): with open(filepath, 'r') as stream: contents = stream.read() print contents 1行ずつ def read_file(filepath): with open(filepath, 'r') as stream: for line in stream: print line