[Tutor] Equivalent exception of os.path.exists()
alan.gauld at btinternet.com
Mon Nov 30 22:59:53 CET 2009
"Dave Angel" <davea at ieee.org> wrote
> My suspicion is that the author just wants you to try to do an open()
> (readonly), inside a try/except block, and to successfully handle the
And the critical thing here is that it must be an open in read mode.
As others pointed out if you use write mode it will (nearly) always
succeed, even if that means overwriting an existing file.
More information about the Tutor