import module_name
path = os.path.dirname(module_name.__file__)
import a_module
print(a_module.__file__)
import os
# path of the given file
print(os.path.dirname(os.path.abspath("my_file.txt")))
# current working directory
print(os.path.abspath(os.getcwd()))