<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rmatsush</author_name>
  <author_url>https://blog.hatena.ne.jp/rmatsush/</author_url>
  <blog_title>infomisc -ITエンジニア雑記-</blog_title>
  <blog_url>https://infomisc.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>Pythonに関するTipsを忘れないように書いておきます。 自分の場合、仕事上大量のテキストファイルを扱うことが多いので、ファイル読み込みとか、文字列操作に関するTipsが多くなりそうです。 ファイル読み込み#1 with open('/tmp/test.txt') as f: for line in f: print line /tmp/test.txtを読み込んで、1行ずつ出力するプログラムです。 この方法は、ファイルを読み込んだ際にすべてのファイルの中身をメモリに乗せることはないらしいです。 物理メモリサイズに比べてファイルサイズが大きい場合は、この方法が有効になります。 ファイル読み…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finfomisc.hatenablog.com%2Fentry%2F2020%2F01%2F21%2F011320&quot; title=&quot;ファイル読み込み - infomisc -ITエンジニア雑記-&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/r/rmatsush/20200120/20200120013705.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-01-21 01:13:20</published>
  <title>ファイル読み込み</title>
  <type>rich</type>
  <url>https://infomisc.hatenablog.com/entry/2020/01/21/011320</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
