ris*_*war 3 python scripting
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")
Tho*_*aci 5
你的条件不对,你想做:
if os.path.isfile('/root/' + item):
归档时间:
5 年,11 月 前
查看次数:
34 次
最近记录: