名前空間をたとえばsandbox.auto.toolsからsandbox.toolsに短縮したいと思います 。どうすればそれを達成できますか(自動は冗長です)?他のメッセージを調べましたが、探しているものに似たものは実際には見つかりませんでした。以下は私のディレクトリ構造です。
sandbox\auto\tools\foo.py (contains a function display() as described below)
def display():
print "hello"
sandbox\test\bar.py
import sandbox.auto.tools as sandbox.tools (Error)
私は次のことができることを知っています。
sandboox\test\bar.py
from sandbox.auto.tools import foo as tools
tools.display()
提案/ポインタはありますか?