Tim Williams wrote:
> Alternatively there is os.path.exists which works for files or
> directories, but calling it every time you use the wrapper is probably
> more expensive than using the try statement when the program *does*
> exist.
>
> import os.path
> if not os.path.exists('/dir1/dir2/filename'):
>    print_something_and_exit(filename)
>
> :)
>
problem with that is that the path may change between installations on 
different machine and I can't guarantee /dir1/dir2 which is why a test 
of all dirs in the path is more portable.

-- 
Hari Sekhon

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to