{"published":"2022-04-20 19:00:00","categories":["Python"],"url":"https://phst.hateblo.jp/entry/2022/04/20/190000","title":"Python \u52d5\u7684\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u6210\u3001import\u3001\u518dimport (\u30ea\u30ed\u30fc\u30c9) \u3059\u308b","author_name":"onsanai","width":"100%","blog_url":"https://phst.hateblo.jp/","version":"1.0","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/onsanai/","blog_title":"\u7269\u7406\u306e\u99c5 Physics station by \u73fe\u5f79\u7814\u7a76\u8005","description":"Python\u306f\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306a\u306e\u3067\u3001\u6587\u5b57\u5217\u304b\u3089\u52d5\u7684\u306aimport\u304c\u53ef\u80fd\u3067\u3042\u308b\u3002 Python\u306e\u30b3\u30fc\u30c9\u306e\u4e2d\u3067\u3001NewModule.py \u3092\u4f5c\u3063\u3066\u3001\u305d\u308c\u3092\u8aad\u307f\u8fbc\u3093\u3067\u307f\u3088\u3046\u3002 NewModule.py \u306b\u66f8\u304f\u30c6\u30ad\u30b9\u30c8 print(0) a = 10 + 0 Python\u30b3\u30fc\u30c9\u3002import importlib \u304c\u91cd\u8981\u3002 module_name = \"NewModule\" import importlib i=0 with open(f\"{module_name}.py\",\"w\") as f: f.write(f\"print({i})\\n\") f.write(f\"a = 10 + {i}\\n\") mod\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fphst.hateblo.jp%2Fentry%2F2022%2F04%2F20%2F190000\" title=\"Python \u52d5\u7684\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u6210\u3001import\u3001\u518dimport (\u30ea\u30ed\u30fc\u30c9) \u3059\u308b - \u7269\u7406\u306e\u99c5 Physics station by \u73fe\u5f79\u7814\u7a76\u8005\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","provider_url":"https://hatena.blog","type":"rich","image_url":null}