{"image_url":"https://hbb.afl.rakuten.co.jp/hgb/19a27560.c8b57319.19a27561.0f5a4f2e/?me_id=1213310&item_id=20113424&pc=https%3A%2F%2Fthumbnail.image.rakuten.co.jp%2F%400_mall%2Fbook%2Fcabinet%2F9274%2F9784873119274_1_2.jpg%3F_ex%3D240x240&s=240x240&t=pict","width":"100%","published":"2023-03-23 00:08:32","type":"rich","provider_url":"https://hatena.blog","categories":["Python"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpydocument.hatenablog.com%2Fentry%2F2023%2F03%2F23%2F000832\" title=\"Python\u3067\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u969b\u306b\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5 - PyDocument\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"pydoc","version":"1.0","url":"https://pydocument.hatenablog.com/entry/2023/03/23/000832","author_url":"https://blog.hatena.ne.jp/pydoc/","blog_title":"PyDocument","description":"Python\u3092\u4f7f\u3063\u3066\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u969b\u306b\u767a\u751f\u3057\u3084\u3059\u3044\u30a8\u30e9\u30fc\u3068\u305d\u306e\u5bfe\u51e6\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002 \u57fa\u672c: \u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f \u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u305d\u306e\u539f\u56e0\u3001\u5bfe\u51e6\u6cd5 \u4f8b\u5916\u51e6\u7406\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9 \u307e\u3068\u3081 \u57fa\u672c: \u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f Python\u3067\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3001open()\u95a2\u6570\u3068with\u6587\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u3002 with open(\"sample.txt\", \"r\", encoding=\"utf-8\") as f: content = f.read() print(content) \u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c9\u306e\u6307\u5b9a\u306b\u6307\u5b9a\u306b\u3064\u3044\u3066: encoding=\"...\" \u30a8\u30f3\u2026","height":"190","provider_name":"Hatena Blog","blog_url":"https://pydocument.hatenablog.com/","title":"Python\u3067\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u969b\u306b\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5"}