I am loading a dll with ctypes under Cygwin with the following: import ctypes ctypes.cdll.LoadLibrary('foo.dll') How can I get the absolute path of my dll? The problem is that I have absolutely no clues where the dll is located. Can I relate on the following to get this information? subprocess.Popen(["which", lib], stdout=subprocess.PIPE).stdout.read().strip() Continue reading...