how do i check if a file exists with python?

Moshe Zadka moshez at
Sun Dec 31 10:21:31 EST 2000

On Fri, 29 Dec 2000 09:30:38 +0100, "Alex Martelli" <aleaxit at> wrote:

> When somebody asks how to determine whether a file exists, it IS quite
> likely that what they mean is something different
> It's unlikely, although of course possible, that 'actual existence'
> is exactly what one needs to determine

In that case, on a typical OS (even Windows-like, although it's more
pronounced on UNIX) one *can't* know the answer, in general. Consider
stuff like unreadable directories, for example.

when-you-open-the-box-ly y'rs, Z.
Moshe Zadka <sig at>
This is a signature anti-virus. 
Please stop the spread of signature viruses!

More information about the Python-list mailing list