Tuesday, 20 August 2013

verify presence of file in parent directory

verify presence of file in parent directory

I'm trying to verify if a file exists in the parent directory. The
following doesn't seem to be working and i'm not sure why:
import os
if os.path.join(os.pardir + '/foo'):
print "true"
else:
print "false"

No comments:

Post a Comment