小编ris*_*war的帖子

这个脚本总是返回未知。即使我的根文件夹中有文件和目录?

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")
Run Code Online (Sandbox Code Playgroud)

python scripting

3
推荐指数
1
解决办法
34
查看次数

标签 统计

python ×1

scripting ×1