I want to find the complete path of a file (name is user input) within a computer. I tried os.path.dirname(filename)
and os.path.abspath(filename)
, but all it does is return the path of the file added to the current working directory.
For example, let IntelGFX.txt
be a file with path C:\Intel\Logs\IntelGFX
, but the path I get on using os.path.abspath('IntelGFX')
is C:\Python34\IntelGFX
.
So how do I get the original path of the file?