Discuss / Python / 第二题

第二题

Topic source

谭晓见

#1 Created at ... [Delete] [Delete and Lock User]

!/bin/usr/env python

import os,sys if len(sys.argv) < 2: print "useage:\python script_name.py find_str" sys.exit() find_str = sys.argv[1] for root,dirs,files in os.walk(os.getcwd()): for f in files: if f.find(find_str) != -1: print root + os.sep + f


  • 1

Reply