import os import time paths={'e':'/windows/e', 'g':'/windows/G', 'f':'/windows/f', 'z':'/usr/z'} while True: with open('111.txt','a')as fout: print >>fout, time.strftime("%d.%m.%Y %H:%M:%S") for name in paths.keys(): print >>,fout '%s acces - %s'%( name,os.access(paths[name],os.F_OK)) time.sleep(1)