Smart way to end a subroutine if file doesnt exist in cwd
<p>I am trying to open file "data.txt" in the cwd and readthe lines,is there a oneliner(or close ) to exit the subroutine if the file doesnt exist..i know there are ways like using os.path.exists and try/except IO error but am interested in one-liner or the smartest way</p>

<pre><code>def readfile ():
    f = open('data.txt')
    lines = f.readlines()
    f.close()
</code></pre>
