{"id":65,"date":"2014-06-20T00:58:27","date_gmt":"2014-06-19T15:58:27","guid":{"rendered":"https:\/\/www.dogrow.net\/python\/?p=65"},"modified":"2019-10-19T06:30:59","modified_gmt":"2019-10-18T21:30:59","slug":"blog21","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/python\/blog21\/","title":{"rendered":"(21) reload\u3067\u5f37\u5236import"},"content":{"rendered":"<p>\u81ea\u4f5c\u306e\u30e2\u30b8\u30e5\u30fc\u30eb mylib.py\u3092\u7701\u7565\u540d ml\u3067 <span class=\"my_fc_deeppinkB\">import<\/span>\u3059\u308b\u3002<\/p>\n<pre>&gt;&gt;&gt; <span class=\"my_fc_deeppinkB\">import<\/span> mylib as ml\r\n<\/pre>\n<p>mylib.py\u3092\u5225\u753b\u9762\u4e0a\u3067\u7de8\u96c6\u3057\u305f\u5f8c\u3001\u3053\u308c\u3092\u53cd\u6620\u3055\u305b\u305f\u3044\u5834\u5408\u3001\u518d\u5ea6import\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n<pre>&gt;&gt;&gt; <span class=\"my_fc_deeppinkB\">import<\/span> mylib as ml\r\n<\/pre>\n<p>\u3053\u308c\u3067\u306f\u518d\u5ea6import\u3055\u308c\u306a\u3044&#8230;<\/p>\n<p>\u5f37\u5236import\u3055\u305b\u308b\u306b\u306f <span class=\"my_fc_deeppinkB\">reload<\/span>\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n<pre>&gt;&gt;&gt; <span class=\"my_fc_deeppinkB\">reload<\/span>(ml)\r\n&lt;module 'mylib' from 'mylib.py'&gt;\r\n<\/pre>\n<h1 class=\"my_h\">\u8ffd\u8a18\uff1aPython3\u3067\u4ed5\u69d8\u5909\u66f4\u3042\u308a<\/h1>\n<p>python3\u3067\u306f <span class=\"my_fc_deeppinkB\">reload<\/span> \u304c\u4f7f\u3048\u306a\u304f\u306a\u3063\u305f\u3002<br \/>\n\u540c\u3058\u3053\u3068\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u73fe\u3067\u304d\u308b\u3002<\/p>\n<pre>\r\nimport importlib\r\nimportlib.reload(xxxxxxxx)\r\n<\/pre>\n<p>\u3072\u3068\u624b\u9593\u5897\u3048\u305f\u611f\u3058\u3067\u3059\u3002<\/p>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u4f5c\u306e\u30e2\u30b8\u30e5\u30fc\u30eb mylib.py\u3092\u7701\u7565\u540d ml\u3067 import\u3059\u308b\u3002 &gt;&gt;&gt; import mylib as ml mylib.py\u3092\u5225\u753b\u9762\u4e0a\u3067\u7de8\u96c6\u3057\u305f\u5f8c\u3001\u3053\u308c\u3092\u53cd\u6620\u3055\u305b\u305f\u3044\u5834\u5408\u3001\u518d\u5ea6import\u3059\u308c\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/python\/blog21\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-4"],"views":11185,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":11,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":2603,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/65\/revisions\/2603"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}