{"id":11,"date":"2017-01-03T16:18:22","date_gmt":"2017-01-03T07:18:22","guid":{"rendered":"http:\/\/www.python.ambitious-engineer.com\/?p=11"},"modified":"2019-05-06T19:15:31","modified_gmt":"2019-05-06T10:15:31","slug":"python%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0%e3%81%ae%e5%ae%9f%e8%a1%8c%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/11","title":{"rendered":"Python\u306e\u5b9f\u884c\u65b9\u6cd5"},"content":{"rendered":"<h2>Hello World<\/h2>\n<p>\u74b0\u5883\u69cb\u7bc9\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u3055\u3063\u305d\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Python\u306f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a18\u8ff0\u3057\u3001\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3068\u306f\u5225\u306b\u3001\u5bfe\u8a71\u30e2\u30fc\u30c9\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b<\/h3>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u30e1\u30e2\u5e33\u3084vim\u306a\u3069\u304a\u597d\u304d\u306a\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\u3001hello_python.py\u3068\u3044\u3046\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u66f8\u304d\u8fbc\u3093\u3067\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<strong>python\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u62e1\u5f35\u5b50\u306f.py<\/strong>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nprint('Hello Python World')\r\n<\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5165\u529b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u3001Linux\u3084Mac\u3092\u304a\u4f7f\u3044\u306e\u65b9\u306f\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u8d77\u52d5\u3057\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u305f\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u3066\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08<strong>\u4eca\u5f8c\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u8a18\u53f7\u306f$\u3067\u8868\u73fe\u3057\u307e\u3059\u3002<\/strong>\uff09<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ python hello_python.py\r\nHello Python World\r\n<\/pre>\n<p>\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\uff1fHello Python World\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u51fa\u529b\u3055\u308c\u307e\u3057\u305f\u3067\u3057\u3087\u3046\u304b\uff1fprint\u3068\u3044\u3046\u95a2\u6570\u3067\u6587\u5b57\u5217\u3092\u6a19\u6e96\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>C\u8a00\u8a9e\u3084Java\u3068\u306f\u7570\u306a\u308a\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u305b\u305a\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>\u5bfe\u8a71\u30e2\u30fc\u30c9\u3067\u5b9f\u884c\u3059\u308b<\/h3>\n<p>\u4eca\u5ea6\u306f\u5bfe\u8a71\u30e2\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u4eca\u5ea6\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u4e0a\u3067python\u3068\u5165\u529b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ python\r\nPython 3.5.1 (default, Apr 24 2016, 23:33:22) \r\n[GCC 5.3.1 20160413] on linux\r\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\r\n&gt;&gt;&gt; \r\n<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u3001\">>>\"\u3067\u958b\u59cb\u3055\u308c\u308b\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8d77\u52d5\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001\u7d9a\u3051\u3066print\u95a2\u6570\u3092\u5165\u529b\u3057\u3066\u30a8\u30f3\u30bf\u30fc\u30ad\u30fc\u3092\u62bc\u4e0b\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u304c\u51fa\u529b\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&gt;&gt;&gt; print('Hello Python World')\r\nHello Python World\r\n<\/pre>\n<p>Python\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u305b\u305a\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306a\u306e\u3067\u3059\u3002<\/p>\n<h4>\u30b3\u30fc\u30c9\u88dc\u5b8c<\/h4>\n<p>\u5bfe\u8a71\u30e2\u30fc\u30c9\u306e\u4fbf\u5229\u306a\u70b9\u3068\u3057\u3066\u3001\u30b3\u30fc\u30c9\u88dc\u5b8c\u306e\u6a5f\u80fd\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002\u8a66\u3057\u306b\u3001pri\u307e\u3067\u5165\u529b\u3057\u3066Tab\u30ad\u30fc\u3092\u62bc\u4e0b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\"print(\"\u307e\u3067\u88dc\u5b8c\u3055\u308c\u305f\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u7d44\u8fbc\u307f\u95a2\u6570\u4ee5\u5916\u306b\u3001\u81ea\u5206\u3067\u5b9a\u7fa9\u3057\u305f\u8b58\u5225\u5b50\u3082\u88dc\u5b8c\u3055\u308c\u308b\u305f\u3081\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<h4>\u5bfe\u8a71\u30e2\u30fc\u30c9\u306e\u7d42\u4e86<\/h4>\n<p>\u5bfe\u8a71\u30e2\u30fc\u30c9\u3092\u7d42\u4e86\u3059\u308b\u5834\u5408\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bquit()\u3067\u7d42\u4e86\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&gt;&gt;&gt; quit()\r\n$\r\n<\/pre>\n<p>\u3055\u3066\u3001\u7c21\u5358\u306b\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u4fbf\u5229\u306a\u5bfe\u8a71\u5f62\u5f0f\u3067\u3059\u304c\u3001\u5f53\u30b5\u30a4\u30c8\u3067\u306f\u8aad\u8005\u304c\u30b3\u30d4\u30da\u3057\u3084\u3059\u3044\u3088\u3046\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5f62\u5f0f\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u5bfe\u8a71\u5f62\u5f0f\u3060\u3068>>> \u304c\u982d\u306b\u3064\u304f\u305f\u3081\u3002\uff09\u307b\u3068\u3093\u3069\u30b5\u30f3\u30d7\u30eb\u306f\u5bfe\u8a71\u5f62\u5f0f\u3067\u3082\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>Python\u306e\u57fa\u672c<\/h2>\n<p>\u3067\u306f\u3001\u6b21\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3082\u3046\u5c11\u3057\u9577\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3066Python\u306e\u7279\u5fb4\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef main():\r\n    &quot;&quot;&quot; \r\n    \u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c83\u3064\u3067docstring\u3068\u306a\u308a\u307e\u3059\r\n    \u3053\u3053\u306bmain\u95a2\u6570\u306e\u8aac\u660e\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\r\n    &quot;&quot;&quot;\r\n\r\n    # \u901a\u5e38\u306e\u30b3\u30e1\u30f3\u30c8\u306f#\u3092\u4f7f\u3044\u307e\u3059\u3002\r\n    # \u901a\u5e38\u306e\u6587\u3068\u540c\u69d8\u306b\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\r\n    print(&quot;hello world!&quot;)\r\n\r\n    # pass\u306f\u3001\u4f55\u3082\u3057\u306a\u3044\u6587\u3067\u3059\r\n    pass\r\n    \r\n\r\nif __name__ == &quot;__main__&quot;:\r\n    main() # \u3082\u3061\u308d\u3093\u3001\u6587\u306e\u5f8c\u306b\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\r\n\r\n<\/pre>\n<p>\u4e00\u3064\u3065\u3064\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30a4\u30f3\u30c7\u30f3\u30c8<\/h3>\n<p>Python\u306e\u7279\u5fb4\u306e\u4e00\u3064\u306b\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u51e6\u7406\u306e\u30d6\u30ed\u30c3\u30af\u3054\u3068\u306b\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u3064\u3051\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>C\u3001C++\u3001Java\u3001C#\u3001PHP\u3001e.t.c.\u901a\u5e38\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30af\u30e9\u30b9\u3001\u95a2\u6570\u3001\u5236\u5fa1\u6587\u306e\u307e\u3068\u307e\u308a\u306e\u30d6\u30ed\u30c3\u30af\u306f\u4e2d\u62ec\u5f27\u3067\u304f\u304f\u308b\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u304c\u3001Python\u3067\u306f\u30a4\u30f3\u30c7\u30f3\u30c8\u3067\u30d6\u30ed\u30c3\u30af\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30f3\u30c8\u306b\u306f\u30bf\u30d6\u3001\u30b9\u30da\u30fc\u30b9\u306e\u3069\u3061\u3089\u3092\u5229\u7528\u3057\u3066\u3082\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001PEP8\u3068\u3044\u3046\u898f\u7d04\u4e0a\u3067\u306f\u30b9\u30da\u30fc\u30b94\u6587\u5b57\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u9593\u9055\u3048\u308b\u3068\u3001\u8aa4\u3063\u305f\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u305f\u308a\u3001\u5b9f\u884c\u305d\u306e\u3082\u306e\u304c\u5931\u6557\u3059\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30b3\u30e1\u30f3\u30c8\u3068\u30c9\u30c3\u30af\u30b9\u30c8\u30ea\u30f3\u30b0<\/h3>\n<p>Python\u306e\u30b3\u30e1\u30f3\u30c8\u306f#\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 #\u4ee5\u964d\u306e\u6587\u5b57\u5217\u306f\u51e6\u7406\u3055\u308c\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u3001\u4ed6\u306e\u6587\u3068\u540c\u69d8\u3001\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u300116\u884c\u76ee\u306e\u3088\u3046\u306b\u6587\u306e\u5f8c\u306b\u30b3\u30e1\u30f3\u30c8\u3092\u6253\u3064\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c83\u3064\u3067\u30c9\u30c3\u30af\u30b9\u30c8\u30ea\u30f3\u30b0\u3068\u3044\u3046\u30af\u30e9\u30b9\u3084\u95a2\u6570\u306e\u4ed5\u69d8\u3092\u8a18\u8ff0\u3059\u308b\u305f\u3081\u306e\u30b3\u30e1\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>if __name__ == \"__main__\":<\/h3>\n<p>\u5f8c\u3005\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u304c\u3001\u73fe\u6642\u70b9\u3067\u306f\u8d77\u52d5\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3053\u3046\u3044\u3046\u66f8\u304d\u65b9\u3092\u3059\u308b\u3082\u306e\u3060\u3001\u305f\u3060\u306e\u304a\u4f5c\u6cd5\u306e\u4e00\u3064\u306a\u3093\u3060\u3001\u3068\u601d\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u6c17\u306b\u306a\u308b\u65b9\u306f\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<div class=\"related_article cf\"><a href=\"https:\/\/www.python.ambitious-engineer.com\/archives\/950\" class=\"cf\"><figure class=\"eyecatch thum\"><img width=\"300\" height=\"200\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2017\/04\/eyecatch_module_run-300x200.png\" class=\"attachment-home-thum size-home-thum wp-post-image\" alt=\"\" loading=\"lazy\" \/><\/figure><div class=\"meta inbox\"><p class=\"ttl\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b9f\u884c\u3068__name__<\/p><span class=\"date\">2017\u5e744\u670819\u65e5<\/span><\/div><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello World \u74b0\u5883\u69cb\u7bc9\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u3055\u3063\u305d\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 Python\u306f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a18\u8ff0\u3057\u3001\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3068\u306f\u5225\u306b\u3001\u5bfe\u8a71\u30e2\u30fc\u30c9\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059...<\/p>\n","protected":false},"author":1,"featured_media":589,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":18,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":3150,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/11\/revisions\/3150"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media\/589"}],"wp:attachment":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}