#!/usr/bin/python#-*-conding:utf-8-*-#获取目录下文件的绝对路径import osdef getabsroute(path): listdir = os.listdir(path) filepath = os.getcwd() allfile = [] for file in listdir: allfile.append(filepath + '\\' + file) print(allfile)getabsroute('E:\\java')
本文共 316 字,大约阅读时间需要 1 分钟。
#!/usr/bin/python#-*-conding:utf-8-*-#获取目录下文件的绝对路径import osdef getabsroute(path): listdir = os.listdir(path) filepath = os.getcwd() allfile = [] for file in listdir: allfile.append(filepath + '\\' + file) print(allfile)getabsroute('E:\\java')
转载于:https://www.cnblogs.com/evablogs/p/7096364.html