I have a file, for example "something.exe" and I want to find path to this file How can I do this in python?
Perhaps os.path.abspath() would do it:
os.path.abspath()
import os print os.path.abspath("something.exe")
If your something.exe is not in the current directory, you can pass any relative path and abspath() will resolve it.
something.exe
abspath()
2.1m questions
2.1m answers
60 comments
56.9k users