#!/usr/bin/env python
from__future__importprint_functionimportosimportsysdefcheck_path(argv):iflen(argv)<3:print("Wrong number of args")return1type=argv[1]paths=argv[2:]exit_code=0iftype=='dir':foridx,dirinenumerate(paths):print(os.path.isdir(dir))eliftype=='file':foridx,fileinenumerate(paths):print(os.path.isfile(file))else:print("Unrecognised type {}".format(type))exit_code=1returnexit_codeif__name__=='__main__':sys.exit(check_path(sys.argv))