import os os.path.dirname(os.path.realpath(__file__))
#basename with extension basename = os.path.basename(path)