{"id":1875,"date":"2020-05-08T17:04:43","date_gmt":"2020-05-08T08:04:43","guid":{"rendered":"http:\/\/int-info.com\/?page_id=1875"},"modified":"2020-11-06T14:37:09","modified_gmt":"2020-11-06T05:37:09","slug":"bottle_ts","status":"publish","type":"page","link":"http:\/\/int-info.com\/index.php\/bottle_ts\/","title":{"rendered":"python web\u30a2\u30d7\u30ea\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0"},"content":{"rendered":"<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u672c\u756a\u74b0\u5883\u3067\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3055\u305b\u305f\u3068\u304d\u306b\u51fa\u73fe\u3059\u308b\u3001\u308f\u3051\u306e\u308f\u304b\u3089\u306a\u3044\u30a8\u30e9\u30fc\u306b\u5bfe\u3059\u308b\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u3067\u3059\u3002<\/p>\n<p><\/br><\/p>\n<h2>py\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u305f\u306e\u306b\u53cd\u6620\u3055\u308c\u306a\u3044\u3002 <\/h2>\n<p>HTML\u751f\u6210\u306e\u305f\u3081\u306epy\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u305f\u306e\u306b\u3001\u3068\u304d\u3069\u304d\u6614\u306epy\u30d5\u30a1\u30a4\u30eb\u304c\u53c2\u7167\u3055\u308c\u3066\u3057\u307e\u3046\u554f\u984c\u304c\u8d77\u3053\u308b\u3002<\/p>\n<p>\u30fb\u300c__pycash__\u300d\u306e\u4e2d\u306b\u5165\u3063\u3066\u3044\u308bpyc\u30d5\u30a1\u30a4\u30eb\u3092\u9664\u53bb<br \/>\n\u30fbsystemctl restart httpd \u3067\u30ea\u30b9\u30bf\u30fc\u30c8<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3053\u308c\u3092\u884c\u3046\u3068\u554f\u984c\u304c\u89e3\u6d88\u3055\u308c\u305f\u3002\u7406\u7531\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u304c\u3001\u305d\u3046\u3044\u3046\u7656\u3092\u3064\u3051\u3066\u304a\u304f\u3068\u3088\u304b\u308d\u3046\u3002<\/p>\n<p><\/br><\/p>\n<h2>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u751f\u6210\u6642\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc: <\/h2>\n<p>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u306b\u3042\u308bpy\u30d5\u30a1\u30a4\u30eb\u306e\u306a\u304b\u306b\u3001file\u3084output\u306a\u3069\u306e\u753b\u50cf\u4fdd\u5b58\u7528\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u3042\u308b\u3068\u3059\u308b\u3002\u3053\u3053\u306b\u3001py\u30d5\u30a1\u30a4\u30eb\u306eplt.savefig\u306a\u3069\u3067\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308d\u3046\u3068\u3059\u308b\u3068\u3001Error: 500 Internal Server Error \/ Permission denied\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u51fa\u308b\u3002<\/p>\n<p>\u30fb\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08file, output\u306a\u3069\uff09\u306e\u6240\u6709\u8005\u3092 apache \u306b\u3059\u308b\u3053\u3068<br \/>\n\u30fbapache\u306b\u5bfe\u3057\u3066\u3001\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6a29\u9650\u3092\u3001\u300cw: \u66f8\u304d\u8fbc\u307f(2)\u300d\u3068\u300cx: \u5b9f\u884c(1)\u300d\u3092\u4e0e\u3048\u308b\u3053\u3068\u3002\u3064\u307e\u308a\u30013\u304b7\u3092\u6307\u5b9a\u3059\u308b\u3002\u3053\u308c\u306f\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210\u306a\u3069\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u8fbc\u307f\u304c\u5fc5\u8981\u3068\u306a\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>ls -l\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3061\u3001<\/p>\n<pre>\r\n\r\ndrwxr-xr-x 2 apache xxx 24 May 8 17:40 yyy\r\n<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u6240\u6709\u8005\u540d\u304capache\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3001\u6240\u6709\u8005\u306e\u6a29\u9650\u306bwx\u304c\u3042\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002\u306a\u3044\u5834\u5408\u306f\u3001<\/p>\n<pre>\r\nchown apache:xxx yyy\r\nchmod 755 yyy\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001apache\u3092\u6240\u6709\u8005\u306b\u3057\u3001\u6a29\u9650\u306b7\u304b3\u3092\u4e0e\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u5927\u4e8b\u306a\u306e\u306f\u3001\u6240\u6709\u8005\u306b\u6a29\u9650\u3092\u4e0e\u3048\u308b1\u3064\u76ee\u306e\u6570\u5b57\u3067\u3059\u3002xxx\u306f\u4e00\u822c\u30e6\u30fc\u30b6\u540d\uff08ssh\u63a5\u7d9a\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\uff09\u3001yyy\u306f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u3092\u751f\u6210\u3059\u308b\u5148\u3067\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3067\u3059\u3002chmod\u30b3\u30de\u30f3\u30c9\u3092\u304b\u3051\u308b\u3068\u304d\u306f\u3001<\/p>\n<pre>\r\nchmod 755 \/var\/ ... \/\u30a2\u30c0\u30d7\u30bf\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001\u30d5\u30eb\u30d1\u30b9\u3067\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001py\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u306b\u3001\u753b\u50cf\u306e\u4fdd\u5b58\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30eayyy\u306f\u3001<\/p>\n<pre>\r\n\r\n@route('\/yyy\/<filename:path>') # (2) \u3053\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\r\ndef static(filename):\r\n    return static_file(filename, root = os.getcwd() + \"\/yyy\")\r\n<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u5fc5\u305a\u8a18\u8f09\u3057\u3066\u304a\u304f\u3053\u3068\u3002os.getcwd\u306fpy\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3059\u3002\u305d\u308c\u306b&#8221;\/yyy&#8221;\u3092\u8db3\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30d5\u30eb\u30d1\u30b9\u3067\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u66f8\u3044\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p><\/br><\/p>\n<h2>\u6614\u306e\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\uff08html\u5074\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u554f\u984c\uff09\u3002<\/h2>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u554f\u984c\u3067\u3059\u3002\u5bfe\u7b56\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001img\u30bf\u30b0\u3067\u6307\u5b9a\u3059\u308b\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u5f8c\u308d\u306b\u3001\uff1f\u3092\u3064\u3051\u3066\u3001\u9069\u5f53\u306a\u6587\u5b57\u5217\u3092\u5165\u308c\u307e\u3059\u3002\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u73fe\u5728\u6642\u523b\u3092\u7a81\u3063\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u30ad\u30e3\u30c3\u30b7\u30e5\u5bfe\u7b56\u3067\u691c\u7d22\u3059\u308b\u3068\u3001\u4f3c\u305f\u3088\u3046\u306a\u8a18\u8ff0\u304c\u51fa\u3066\u304f\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre>\r\n\r\nimport time\r\ncashtime = time.time()\r\ncss = css + '<script>'\r\ncss = css + '   window.onload = function () { '\r\ncss = css + '       document.getElementById(\"img01\").src = \"file\/SEIR_1.png?' + str(cashtime) + '\";'\r\ncss = css + '       document.getElementById(\"img02\").src = \"file\/SEIR_2.png?' + str(cashtime) + '\";'\r\ncss = css + '   };'\r\ncss = css + '<\/script>'\r\n<\/pre>\n<p><\/br><\/p>\n<h2>10%\u304f\u3089\u3044\u306e\u78ba\u7387\u3067\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3059\u308b\u3002<\/h2>\n<p>\u307b\u3068\u3093\u3069\u3046\u307e\u304f\u52d5\u304f\u306e\u306b\u300110%\u304f\u3089\u3044\u306e\u7a00\u306b\u3088\u304f\u3042\u308a\u305d\u3046\u306a\u78ba\u7387\u3067\u3001\u753b\u50cf\u304c\uff1f\u30de\u30fc\u30af\u3067\u30ed\u30fc\u30c9\u3067\u304d\u3066\u3044\u306a\u304b\u3063\u305f\u308a\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306ehtml\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044\u3060\u3068\u304b\u3001\u305d\u3093\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u30ed\u30fc\u30c9\u3084\u753b\u50cf\u4fdd\u5b58\u306e\u547d\u4ee4\u304b\u3089\u3001html\u306b\u53cd\u6620\u3055\u305b\u308b\u3068\u3044\u3046\u6d41\u308c\u306e\u4e2d\u3067\u3001\u524d\u306e\u51e6\u7406\u304c\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\u306e\u306bhtml\u306b\u53cd\u6620\u3055\u305b\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u539f\u56e0\u3067\u3042\u308b\u3002<\/p>\n<p>\u305d\u3093\u306a\u3068\u304d\u306f\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u305f\u5f8c\u306a\u3069\u306b\u3001<\/p>\n<pre>\r\n\r\nimport time\r\nn=2\r\ntime.sleep(n)\r\n<\/pre>\n<p>\u3092\u66f8\u304f\u3068\u826f\u3044\u3002\u3053\u308c\u3067n\u79d2\u306e\u9045\u5ef6\u51e6\u7406\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<p>n=0.1 \u304f\u3089\u3044\u3067\u8a66\u3057\u3066\u307f\u3066\u3001\u30c0\u30e1\u305d\u3046\u306a\u3089 n = 2 \u306a\u3069\u3001\u5927\u304d\u3081\u306b\u3057\u3066\u3044\u304f\u3002\u305f\u3060\u3057\u9045\u3044\u3068\u30b9\u30c8\u30ec\u30b9\u306a\u306e\u3067\u3001\u3044\u3044\u611f\u3058\u306e\u5024\u3092\u9811\u5f35\u3063\u3066\u898b\u3064\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u53d6\u308a\u6025\u304e\u3001run\u306e\u524d\u306b2\u79d2\u9045\u5ef6\u3092\u5165\u308c\u3066\u307f\u308b\u3068\u3001\u30ed\u30fc\u30c9\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u304f\u306a\u3063\u305f\u3002<\/p>\n<p>\u3082\u3046\u3061\u3087\u3063\u3068\u30b9\u30de\u30fc\u30c8\u306a\u65b9\u6cd5\u304c\u306a\u3044\u304b\u3001\u63a2\u3057\u4e2d\u3002Javascript\u3060\u3051\u306a\u3089\u3059\u3050\u306b\u5bfe\u7b56\u304c\u3067\u304d\u308b\u3082\u306e\u306e\u3002\u3002\u3002<\/p>\n<p><\/br><\/p>\n<h2>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\uff08html\uff09\u306e\u30ed\u30fc\u30c9\u30a8\u30e9\u30fc<\/h2>\n<p>\u8907\u6570\u306e\u30dd\u30fc\u30c8\u3067\u516c\u958b\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u30ed\u30fc\u30c9\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u308b\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<ul>\n<li>\n\u30dd\u30fc\u30c8\u5225\u306b\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8html\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u5225\u3005\u306b\u3059\u308b\uff08\u540c\u3058\u3060\u3068\u3001\u307e\u305a\u3044\u307f\u305f\u3044\u3067\u3059\uff09\n<\/li>\n<li>\n\u30a2\u30d7\u30ea\u3092\u516c\u958b\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u306b\u3001__pychash__\u304c\u3042\u308b\u3002\u305d\u306e\u4e2d\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u306e\u3067\u3001\u524a\u9664\u3059\u308b\u3002\n<\/li>\n<li>\n\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3059\u308b\u3002\n<\/li>\n<\/ul>\n<p>\u3053\u308c\u3067\u30b9\u30c3\u30ad\u30ea\u3059\u308b\u3002\u7279\u306b\u3001\u8b0e\u306e\u30a8\u30e9\u30fc\u306f\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3088\u304f\u306a\u308b\u3053\u3068\u304c\u591a\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u672c\u756a\u74b0\u5883\u3067\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3055\u305b\u305f\u3068\u304d\u306b\u51fa\u73fe\u3059\u308b\u3001\u308f\u3051\u306e\u308f\u304b\u3089\u306a\u3044\u30a8\u30e9\u30fc\u306b\u5bfe\u3059\u308b\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u3067\u3059\u3002 py\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u305f\u306e\u306b\u53cd\u6620\u3055\u308c\u306a\u3044\u3002 HTML\u751f\u6210\u306e\u305f\u3081\u306epy\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u305f\u306e\u306b\u3001<\/p><\/div>\n<div class=\"blog-btn\"><a href=\"http:\/\/int-info.com\/index.php\/bottle_ts\/\" class=\"home-blog-btn\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1875","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/pages\/1875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/comments?post=1875"}],"version-history":[{"count":20,"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/pages\/1875\/revisions"}],"predecessor-version":[{"id":2197,"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/pages\/1875\/revisions\/2197"}],"wp:attachment":[{"href":"http:\/\/int-info.com\/index.php\/wp-json\/wp\/v2\/media?parent=1875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}