常用的一些
1 import os 2 3 for d, cd, fl in os.wald('.'): 4 for f in fl: 5 sufix = os.path.splitext(f)[1][1:] 6 if sufix == 'py': 7 filename = os.path.join(d,f) 8 print 'file name is : ' + filename
常用的一些
1 import os 2 3 for d, cd, fl in os.wald('.'): 4 for f in fl: 5 sufix = os.path.splitext(f)[1][1:] 6 if sufix == 'py': 7 filename = os.path.join(d,f) 8 print 'file name is : ' + filename