{"id":1149,"date":"2018-09-04T00:10:56","date_gmt":"2018-09-03T15:10:56","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1149"},"modified":"2018-09-03T09:18:20","modified_gmt":"2018-09-03T00:18:20","slug":"%e3%80%90python%e3%80%91%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e8%aa%ad%e3%81%bf%e8%be%bc%e3%81%bf%e6%96%b9%e6%b3%95%e3%82%92%e3%82%8f%e3%81%8b%e3%82%8a%e3%82%84%e3%81%99%e3%81%8f%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1149","title":{"rendered":"\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac"},"content":{"rendered":"<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u308a<br \/>\n\u66f8\u304d\u8fbc\u3093\u3060\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1065\" target=\"blank\">\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307e\u305b\u308b\u65b9\u6cd5<\/h2>\n<p>Python\u306b\u304a\u3044\u3066\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3092\u884c\u3046\u3068\u3044\u3046\u3053\u3068\u306f<br \/>\n\u305d\u306e\u524d\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d5\u30a1\u30a4\u30eb\u306f\u6700\u7d42\u7684\u306b\u306f\u9589\u3058\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3046\u8003\u3048\u308b\u3068<\/p>\n<div class=\"boxstyle01\">\n<p class=\"check08\">\u30d5\u30a1\u30a4\u30eb\u3063\u3066<\/p>\n<p>1\uff0e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<br \/>\n2\uff0e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u3080\u8fbc\u3080<br \/>\n3\uff0e\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b<\/p><\/div>\n<p>\u3068\u3044\u30463\u30b9\u30c6\u30c3\u30d7\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u305f\u3081\u306b\u306fopen()\u3092\u4f7f\u3044<br \/>\n\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306fread()\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u306b\u306fclose()\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<div class=\"linkcard\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"4\"><tbody><\/tr><tr><td>\u305f\u3068\u3048\u3070\u3042\u306a\u305f\u304cPython\u3092\u4f7f\u3063\u3066\u4f5c\u3063\u305f\u5f62\u614b\u7d20\u89e3\u6790\u30d7\u30ed\u30b0\u30e9\u30e0\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002\u5f62\u614b\u7d20\u89e3\u6790\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002\u21d2\u5f62\u614b\u7d20\u89e3\u6790\u3068\u306f\uff1fPython\u304a\u3059\u3059\u3081\u306e\u5f62\u614b\u7d20\u89e3\u6790\u30c4\u30fc\u30eb\u306f\uff1f\u3067\u3001\u3042\u306a\u305f\u304c\u4f5c\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3060\u308a\u66f8\u304d\u8fbc\u307f\u3092\u3057\u305f\u308a...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=1065\">\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3059\u308b\u65b9\u6cd5<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n<h2>\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\uff5c\u4f8b\u984c<\/h2>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3059\u308b\u305f\u3081\u306b<br \/>\n\u307e\u305a\u306f\u4f8b\u984c1\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\nx = open(&quot;koo.txt&quot;, &quot;r&quot;) \r\ny = x.read() \r\nx.close() \r\n\r\nz = '\\n\u65e5\u672c\u8a9e\u306b\u8a33\u3059\u3068\u901a\u308a\u3092\u6e21\u3063\u3066\u3044\u308b\u982d\u306e\u306f\u3052\u305f\u4eba\u306f\u79c1\u306e\u606f\u5b50\u3067\u3059\u3002'\r\nprint(y + z)<\/pre>\n<p>\u4f8b\u984c1\u3067\u3059\u304c\u3001<br \/>\n\u307e\u305a\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066jupyternotebook\u306b<br \/>\nkoo.txt\u3068\u3044\u3046\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kootext903.jpg\" alt=\"\u30d5\u30a1\u30a4\u30eb\" width=\"372\" height=\"330\" class=\"alignnone size-full wp-image-1152\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kootext903.jpg 372w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kootext903-300x266.jpg 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/p>\n<p>\u3067\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = open(&quot;koo.txt&quot;, &quot;r&quot;) <\/pre>\n<p>open\u95a2\u6570\u3092\u4f7f\u3063\u3066<br \/>\nkoo.txt\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u6b21\u306b\u7b2c2\u5f15\u6570\u306b\u300er\u300f\u3092\u6307\u5b9a\u3057<br \/>\n\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<p>koo.txt\u306e\u4e2d\u8eab\u306f<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/koofairunonakanmi903.jpg\" alt=\"kootxt\" width=\"426\" height=\"131\" class=\"alignnone size-full wp-image-1155\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/koofairunonakanmi903.jpg 426w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/koofairunonakanmi903-300x92.jpg 300w\" sizes=\"(max-width: 426px) 100vw, 426px\" \/><br \/>\n\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u5909\u6570x\u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=416\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u3082\u3057\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u306a\u3089\u300er\u300f\u3067\u306a\u304f\u300ew\u300f\u306b\u3057\u307e\u3059\u3002<br \/>\n\u8a73\u3057\u304f\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1065\" target=\"blank\">\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u305d\u306e\u5f8c\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">y = x.read() <\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001x.read()\u3068\u8a18\u8f09\u3059\u308b\u3053\u3068\u3067\u3001\u5909\u6570x\u306b\u5165\u3063\u3066\u3044\u308b\u60c5\u5831\u3092<br \/>\n\u3059\u3079\u3066\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u8aad\u307f\u8fbc\u3093\u3060\u60c5\u5831\u3092\u5909\u6570y\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002 <\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x.close() <\/pre>\n<p>\u5909\u6570x\u306b\u5165\u3063\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092close\u3092\u4f7f\u3063\u3066\u9589\u3058\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3060\u3051\u3058\u3083\u9762\u767d\u304f\u306a\u3044\u306e\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">z = '\\n\u65e5\u672c\u8a9e\u306b\u8a33\u3059\u3068\u901a\u308a\u3092\u6e21\u3063\u3066\u3044\u308b\u982d\u306e\u306f\u3052\u305f\u4eba\u306f\u79c1\u306e\u606f\u5b50\u3067\u3059\u3002'\r\nprint(y + z)<\/pre>\n<p>\u3068\u3001&#8217;\\n\u65e5\u672c\u8a9e\u306b\u8a33\u3059\u3068\u901a\u308a\u3092\u6e21\u3063\u3066\u3044\u308b\u982d\u306e\u306f\u3052\u305f\u4eba\u306f\u79c1\u306e\u606f\u5b50\u3067\u3059\u3002&#8217;\u3068\u3044\u3046\u6587\u5b57\u5217\u3092<br \/>\n\u5909\u6570z\u306b\u4ee3\u5165\u3057\u3001\u5909\u6570y\u306b\u5165\u3063\u3066\u3044\u308b\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u6587\u5b57\u5217\u3068\u7d50\u5408\u3055\u305b\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\\n\u306f\u6539\u884c\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<br \/>\n\u6587\u5b57\u5217\u306e\u6539\u884c\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=174\" target=\"blank\">\u3010python\u3011print\u3067\u6587\u5b57\u5217\u3092\u6539\u884c\u3059\u308b\u65b9\u6cd5\u3068\u6539\u884c\u3057\u306a\u3044\u65b9\u6cd5<\/a><\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\nThe bald man walking across the street is my son.<br \/>\n\u65e5\u672c\u8a9e\u306b\u8a33\u3059\u3068\u901a\u308a\u3092\u6e21\u3063\u3066\u3044\u308b\u982d\u306e\u306f\u3052\u305f\u4eba\u306f\u79c1\u306e\u606f\u5b50\u3067\u3059\u3002<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/koye903.jpg\" alt=\"fairu\" width=\"486\" height=\"180\" class=\"alignnone size-full wp-image-1156\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/koye903.jpg 486w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/koye903-300x111.jpg 300w\" sizes=\"(max-width: 486px) 100vw, 486px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u4f8b\u984c1\u306e\u3088\u3046\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\nx = open(&quot;koo.txt&quot;, &quot;r&quot;) \r\ny = x.read() \r\nx.close() \r\n\r\nz = '\\n\u65e5\u672c\u8a9e\u306b\u8a33\u3059\u3068\u901a\u308a\u3092\u6e21\u3063\u3066\u3044\u308b\u982d\u306e\u306f\u3052\u305f\u4eba\u306f\u79c1\u306e\u606f\u5b50\u3067\u3059\u3002'\r\nprint(y + z)<\/pre>\n<p>\u3068\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067<br \/>\nkoo.txt\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u3059\u3079\u3066\u8aad\u307f\u8fbc\u3093\u3067<br \/>\n\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u306e\u8a18\u4e8b\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u308a \u66f8\u304d\u8fbc\u3093\u3060\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002 \u8a73\u3057\u304f\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u21d2\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3059\u308b\u65b9\u6cd5 \u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002 \u3010Pyt [&hellip;]","protected":false},"author":1,"featured_media":1045,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,100],"tags":[3,101,116],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1149"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1149"}],"version-history":[{"count":6,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1149\/revisions"}],"predecessor-version":[{"id":1158,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1149\/revisions\/1158"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1045"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}