finding absolute path from a relative path in python
Question: my question is pretty much what the title suggests. my research has led me to
try something like this:

    
    
    import os
    pathname = os.path.abspath("some/relative/directory")
    print pathname
    

this problem is that whenever i do something like this, it simply returns
whatever relative directory i gave it preceded by my python directory. for
example:

C:\Python27\some\relative\directory

which is not even an existing directory on my computer. i understand that the
python interpreter searches the working directory by default, but what i'd
like to do is have it search my entire computer for an absolute path that
contains the partial directory i specify.

the purpose of this is for me to create an exe (using py2exe) that can search
for an arbitrary directory on any computer. is there a method for doing this
in the standard library or through some available module - or would i have to
implement the algorithm myself?


Answer: [`abspath`](http://docs.python.org/library/os.path.html#os.path.abspath) is
based on [`getcwd`](http://docs.python.org/library/os.html#os.getcwd). Most
likely, your current working directory simply isn't what you expect.

You can change the code that launches your script, change directories
manually, or just use
[`chdir`](http://docs.python.org/library/os.html#os.chdir) in Python.

