check file exists

Jeff Bauer jbauer at rubic.com
Mon Jul 31 16:21:46 EDT 2000


Randy Heiland wrote:
> How does one test for whether or not a (Unix) file exists?

    >>> import os
    >>> os.path.exists('/usr/local/bin/python')
    1

The above function is not restricted to Unix.

portable-ly y'rs,

Jeff Bauer
Rubicon Research




More information about the Python-list mailing list