标签:
#coding utf-8 import os def main(): fileDir = ‘F:‘+os.sep+‘aaa‘ for root,dirs,files in os.walk(fileDir): print (root) print (dirs) print (files) os.system(‘pause‘) if __name__==‘__main__‘: main()
>>> ================================ RESTART ================================ >>> F:\aaa [‘4‘] [‘1.txt‘, ‘2.txt‘, ‘3.txt‘] F:\aaa\4 [‘8‘] [‘5.txt‘, ‘6.txt‘, ‘7.txt‘] F:\aaa\4\8 [] [‘10.txt‘, ‘11.txt‘, ‘9.txt‘] >>>
标签:
原文地址:http://www.cnblogs.com/yuuwee/p/5671046.html