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