Modules and packages have a __file__
attribute that has its path information. If the module was imported relative to current working directory, you'll probably want to get its absolute path.
import os.path
import my_module
print(os.path.abspath(my_module.__file__))