{"provider_url":"https://hatena.blog","type":"rich","blog_title":"miok\u2019s diary","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmio-kt.hatenablog.com%2Fentry%2F2017%2F01%2F11%2F093124\" title=\"14 : \u8a00\u8a9e\u51e6\u7406100\u672c\u30ce\u30c3\u30af\u3067Python\u306e\u304a\u52c9\u5f37 - miok\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://mio-kt.hatenablog.com/","width":"100%","version":"1.0","image_url":null,"provider_name":"Hatena Blog","height":"190","description":"\u7b2c\u4e8c\u7ae0 : 14 \u5148\u982d\u304b\u3089N\u884c\u76ee\u3092\u51fa\u529b \u81ea\u7136\u6570N\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306a\u3069\u306e\u624b\u6bb5\u3067\u53d7\u3051\u53d6\u308a\uff0c\u5165\u529b\u306e\u3046\u3061\u5148\u982d\u306eN\u884c\u3060\u3051\u3092\u8868\u793a\u305b\u3088\uff0e\u78ba\u8a8d\u306b\u306fhead\u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3088\uff0e \u30b3\u30fc\u30c9\u306f\u3053\u3093\u306a\u611f\u3058\u3002 file = 'hightemp.txt' N = 4 with open(file) as f: for i, line in enumerate(f): if i < N: line = line.rstrip() print(line) enumerate()\u95a2\u6570\u3092\u4f7f\u3046\u3068for\u6587\u56de\u3059\u3068\u304d\u306b\u4e2d\u8eab\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4e21\u65b9\u53d6\u5f97\u3067\u304d\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\u306d\u3002 line.rstrip()\u306e\u3068\u3053\u308d\u306f\u6539\u884c\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3059\u308b\u305f\u3081\u306b\u4f7f\u3063\u3066\u2026","published":"2017-01-11 09:31:24","author_name":"mio_kt","author_url":"https://blog.hatena.ne.jp/mio_kt/","url":"https://mio-kt.hatenablog.com/entry/2017/01/11/093124","title":"14 : \u8a00\u8a9e\u51e6\u7406100\u672c\u30ce\u30c3\u30af\u3067Python\u306e\u304a\u52c9\u5f37","categories":[]}