python program that returns the path of the given file code example
Example 1: find the path to a file python
import os
print os.path.abspath("something.exe")
Example 2: python get path of file
>>> import os
>>> filepath="/media/rtsuse/some/random/filepath/with/logfile.log"
>>> os.path.dirname(filepath)
'/media/rtsuse/some/random/filepath/with'