[python] How to retrieve a module's path?

import os
path = os.path.abspath(__file__)
dir_path = os.path.dirname(path)