<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>at_yasu</author_name>
  <author_url>https://blog.hatena.ne.jp/at_yasu/</author_url>
  <blog_title>at_yasu's blog</blog_title>
  <blog_url>https://atys.hateblo.jp/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>__import__を使えば動的？にimportをする事が出来ますが、親カレントにあるclassや関数は読めるのかしらと思ったので、ちとテスト。 # test.py #!/usr/bin/env python def test(): print &quot;test function&quot; obj = __import__ (&quot;f.f&quot;) print obj fm = getattr(getattr(obj, &quot;f&quot;), &quot;f&quot;, None) fm() # f/f.py #!/usr/bin/env python def f(): import test print test test.test() pri…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fatys.hateblo.jp%2Fentry%2F20090907%2Fp1&quot; title=&quot; __import__ とディレクトリ構造 - at_yasu&amp;#39;s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-09-07 00:00:00</published>
  <title> __import__ とディレクトリ構造</title>
  <type>rich</type>
  <url>https://atys.hateblo.jp/entry/20090907/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
