for item in os.listdir("/root"): if os.path.isfile(item): print(item + "is a file") elif os.path.isdir(item): print(item + "is a dir") else: print("Unknown")
python scripting
python ×1
scripting ×1