gpt4 book ai didi

python - 在python中获取短路径

转载 作者:可可西里 更新时间:2023-11-01 09:31:21 25 4
gpt4 key购买 nike

如何在 Windows 中使用 python 获取文件的短路径?

我正在使用下面的代码,

#!/usr/bin/python
import os
import sys
fileList = []
rootdir = sys.argv[1]
for root, subFolders, files in os.walk(rootdir):
for file in files:
fileList.append(os.path.join(root,file))
for File in fileList:
print File

最佳答案

关于python - 在python中获取短路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6085688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com