2 つのモジュールがあるとします。
a.py:
import b
print __name__, __file__
b.py:
print __name__, __file__
「a.py」ファイルを実行します。これは以下を出力します:
b C:\path\to\code\b.py
__main__ C:\path\to\code\a.py
質問__main__
: 「b.py」ライブラリ内からモジュール (この場合は「a.py」)へのパスを取得するにはどうすればよいですか?