file test operator

Chris Liechti cliechti at
Sun Aug 11 02:38:18 CEST 2002

xd_pan at (Xiangdong Pan) wrote in 
news:a975fedd.0208101504.66ef0e1d at
> I'm wondering whether python has build-in file test operators, such as
> -x for file is executable or -e for file exists or some similar
> functions, like perl does. If not, how could I perform these kinds of
> tests?

look at the "os" module.
namely the function os.stat() for attributes and
e.g. os.path.exist()


Chris <cliechti at>

More information about the Python-list mailing list