{"id":1065,"date":"2018-08-28T17:49:37","date_gmt":"2018-08-28T08:49:37","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1065"},"modified":"2018-08-28T17:49:37","modified_gmt":"2018-08-28T08:49:37","slug":"%e3%80%90python%e3%80%91%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e9%96%8b%e3%81%8f%e3%83%bb%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ab%e6%9b%b8%e3%81%8d%e8%be%bc%e3%81%bf%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1065","title":{"rendered":"\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30fb\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u305f\u3068\u3048\u3070\u3042\u306a\u305f\u304cPython\u3092\u4f7f\u3063\u3066\u4f5c\u3063\u305f<br \/>\n\u5f62\u614b\u7d20\u89e3\u6790\u30d7\u30ed\u30b0\u30e9\u30e0\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\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<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=926\" target=\"blank\">\u5f62\u614b\u7d20\u89e3\u6790\u3068\u306f\uff1fPython\u304a\u3059\u3059\u3081\u306e\u5f62\u614b\u7d20\u89e3\u6790\u30c4\u30fc\u30eb\u306f\uff1f<\/a><\/p>\n<p>\u3067\u3001\u3042\u306a\u305f\u304c\u4f5c\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3060\u308a<br \/>\n\u66f8\u304d\u8fbc\u307f\u3092\u3057\u305f\u308a\u3059\u308b\u5834\u5408\u3001\u3068\u308a\u3042\u3048\u305a<br \/>\n\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u3044\u3046\u4f5c\u696d\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304b\u306a\u3044\u3068\u8aad\u307f\u8fbc\u3093\u3060\u308a\u66f8\u304d\u8fbc\u3093\u3060\u308a\u3067\u304d\u306a\u3044\u3063\u3066\u3053\u3068\u3067\u3059\u3002<br \/>\n\u3068\u306f\u3044\u3048\u3001\u7279\u306b\u30b3\u30fc\u30c9\u5185\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u306a\u308b\u3068<br \/>\n\u30de\u30a6\u30b9\u3092\u30ab\u30c1\u30ab\u30c1\u3063\u3068\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308b\u308f\u3051\u306b\u3082\u3044\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u306b\u304a\u3044\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u308a<br \/>\n\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3092\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Python\"><span class=\"toc_number toc_depth_1\">1<\/span> \u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u8fbc\u3080\u305f\u3081\u306b\u307e\u305a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u4f5c\u696d\u304c\u5fc5\u8981<\/a><\/li><li><a href=\"#Python-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<\/a><\/li><li><a href=\"#Python-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u3010Python\u3011\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u3088\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u65b9\u6cd5<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Python\">\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u8fbc\u3080\u305f\u3081\u306b\u307e\u305a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u4f5c\u696d\u304c\u5fc5\u8981<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonfairuhiraku827.jpg\" alt=\"\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\" width=\"620\" height=\"414\" class=\"alignnone size-full wp-image-1067\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonfairuhiraku827.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonfairuhiraku827-300x200.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u305f\u3081\u306b\u306f<br \/>\n3\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u8e0f\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"boxstyle01\">\n<p class=\"check08\">\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b3\u30b9\u30c6\u30c3\u30d7\u306f<\/p>\n<p>\u30b9\u30c6\u30c3\u30d71\uff0e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<br \/>\n\u30b9\u30c6\u30c3\u30d72\uff0e\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u51fa\u3059<br \/>\n\u30b9\u30c6\u30c3\u30d73\uff0e\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b<\/p><\/div>\n<p>\u3067\u3059\u3002<\/p>\n<h2><span id=\"Python-2\">\u3010Python\u3011\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<\/span><\/h2>\n<p>\u307e\u305a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u3053\u308d\u304b\u3089\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u984c1\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1 \r\n\r\naisatu = 'Hello! My name is Python'\r\nx = open('konn.txt', 'w')\r\ny = x.write(aisatu)\r\nx.close()\r\nprint(y)<\/pre>\n<p>\u307e\u305a\u4f8b\u984c1\u3067\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">aisatu = 'Hello! My name is Python'<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>Hello!My name is Python\u3068\u3044\u3046\u6587\u5b57\u5217\u3092<br \/>\naisatu\u3068\u3044\u3046\u5909\u6570\u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067<br \/>\n\u8a73\u3057\u304f\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>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = open('konn.txt', 'w')<\/pre>\n<p>open\u306fopen\u95a2\u6570\u3068\u3044\u3044\u307e\u3059\u3002<br \/>\n\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u4f5c\u696d\u3092\u3057\u3066\u304f\u308c\u308b\u3093\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">open(\u30d5\u30a1\u30a4\u30eb\u540d\u6307\u5b9a, \u3069\u3093\u306a\u4ed5\u4e8b\u3092\u3055\u305b\u308b\u304b\uff09<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x = open('konn.txt', 'w')<\/pre>\n<p>\u3067\u306fkonn.txt\u3068\u3044\u3046\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066<br \/>\nw\u3068\u3044\u3046\u4ed5\u4e8b\u3092\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>w\u306f\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001konn.txt\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u4e0a\u8a18\u304c\u5909\u6570x\u306b\u4ee3\u5165\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">y = x.write(aisatu)<\/pre>\n<p>\u6b21\u306b\u5909\u6570x\u306e\u60c5\u5831\u3092write\u3057\u307e\u3059\u3002<br \/>\nwrite\u306f\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u95a2\u6570\u3067\u3059\u3002<\/p>\n<p>\u3057\u304b\u3082write(aisatu)\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067<br \/>\naisatu\u306e\u4e2d\u306b\u5165\u3063\u3066\u3044\u308b\u60c5\u5831\u3092\u6e21\u3059\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u300eHello! My name is Python\u300f\u3092<br \/>\nkonn.txt\u306b\u66f8\u304d\u8fbc\u3093\u3067\u4f55\u6587\u5b57\u3042\u308b\u304b\u8868\u793a\u3059\u308b\u3063\u3066\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">x.close()\r\nprint(y)<\/pre>\n<p>\u66f8\u304d\u8fbc\u307f\u304c\u7d42\u4e86\u3057\u305f\u3089close\u95a2\u6570\u306b\u3088\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u3001<br \/>\n\u305d\u308c\u304b\u3089\u5909\u6570y\u306e\u60c5\u5831\uff08\u6587\u5b57\u6570\uff09\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\nkonn.txt\u306b\u306f<br \/>\nHello! My name is Python<br \/>\n\u3068\u66f8\u304d\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089\u6587\u5b57\u6570\u3068\u3057\u3066<br \/>\n24<br \/>\n\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kontekisuto826.jpg\" alt=\"\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\" width=\"269\" height=\"128\" class=\"alignnone size-full wp-image-1069\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/fairuhiraku827.jpg\" alt=\"\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\" width=\"295\" height=\"153\" class=\"alignnone size-full wp-image-1070\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u30d5\u30a1\u30a4\u30eb\u306b\u6587\u5b57\u5217\u306e\u66f8\u304d\u8fbc\u307f\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2><span id=\"Python-3\">\u3010Python\u3011\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u3088\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u5229\u7528\u3057\u3066<br \/>\n\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u8fbc\u307f\u3092\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067<br \/>\n\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=802\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u4f8b\u984c2\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\r\n\r\naisatu = ['watasi', 'ha', 'Python', 'desu']\r\nx = open('konn.txt', 'w')\r\nfor y in aisatu:\r\n     x.write(y)\r\nx.close()<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u30ea\u30b9\u30c8\u3092\u5909\u6570aisatu\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">aisatu = ['watasi', 'ha', 'Python', 'desu']<\/pre>\n<p>\u30ea\u30b9\u30c8\u306b\u3064\u3044\u3066\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=600\" target=\"blank\">\u3010Python\u3011\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u3053\u3053\u3067\u306e\u30dd\u30a4\u30f3\u30c8\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">for y in aisatu:<\/pre>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u304c\u30eb\u30fc\u30d7\u51e6\u7406\u3067\u3059\u3002<br \/>\n\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=768\" target=\"blank\">\u3010Python\u3011for\u6587\u306e\u66f8\u304d\u65b9\u3092\u8ab0\u3067\u3082\u308f\u304b\u308b\u3088\u3046\u306b\u89e3\u8aac<\/a><\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/sadadv827.jpg\" alt=\"for\u6587\" width=\"265\" height=\"152\" class=\"alignnone size-full wp-image-1071\" \/><\/p>\n<p>\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\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 [&hellip;]","protected":false},"author":1,"featured_media":1066,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,100],"tags":[3,101,102,103],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1065"}],"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=1065"}],"version-history":[{"count":2,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1072,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1065\/revisions\/1072"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1066"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}