Python file does not exist exception
<p>I am trying to open a file and read from it and if the file is not there, I catch the exception and throw an error to stderr. The code that I have:</p>

<pre><code>for x in l:
    try:        
        f = open(x,'r')
    except IOError:
        print &gt;&gt; sys.stderr, "No such file" , x
</code></pre>

<p>but nothing is being printed to stderr, does open create a new file if the file name doesn't exist or is the problem somewhere else?</p>