On 4/30/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: > JOSHUA ABRAHAM wrote: > > I was hoping you guys would consider creating function in os.path or > > otherwise that would find the full path of a file when given only it's base > > name and nothing else.I have been made to understand that this is not > > currently possible. > > Does os.path.abspath() do what you want? > > If not, what exactly *do* you want? probably: def find_in_path(filename): for path in os.environ['PATH'].split(os.pathsep): if os.path.exists(filename): return os.path.abspath(os.path.join(path, filename)) -Mike
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4