How do I return path to file if it exists in python : <p>I have to check that file exists or not, and if it does, have to return path to it , the main problem is that <code>os.path.isdir</code> returns only <code>True</code> or <code>False</code> depending on existence, so it seems it does not fit. Any hints? Current schema in my mind  is:</p>

<pre><code>def get_config_path():
    if exists(path1):
        return path1
    if exists(path2):
        return path2
</code></pre>
