Detect file existance before open?

Lyle Johnson jlj at cfdrc.com
Tue Oct 19 11:48:09 EDT 1999


os.path.exists(filename)

On Sat, 16 Oct 1999 21:06:07 -0600, "Bill Rodgers" <Bill at nospam.com>
wrote:

>I would like to check for the existance of a file before I attempt an open
>and maybe throw an exception.  I don't see a way to do this.  I would like
>to tell the user that the file he specified doesn't exist.  Is there a way
>to do this or do I need to catch the exception and deal with it that way?
>Thanks,
>--
>Bill Rodgers
>Enterprise Management Consultant
>Specialty: BMC/Patrol
>brodg1 at ix.netcom.com
>
>





More information about the Python-list mailing list