checking the existence of a fiel

Peter Solodov solodov at bigfoot.com
Tue Jul 11 12:00:40 EDT 2000


Here's the code:

try:
    file = open("some_file")
except IOError:
    print 'Error:  Couldn\'t create temp file.'
    sys.exit(0)

Fernando RodrМguez [frr at mindless.com] wrote:

> Hi!
> 
>     How can I check if a file exists? O:-)
> 
> TIA
> 
> --
> 
> 
> ---------------------------------------
> Fernando RodrМguez
> 
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list