2012-11-03 wcdj
遗留问题:如何处理中文
#-*- coding: gbk -*-
############
# 20121003 wcdj
# FindFilev0.1
# 遍历目录和搜索文件中的关键字
############
# import module
import os
import sys
import cmd
# test
#print os.listdir('e:\\')
print "Beg"
print sys.argv
class Tool(cmd.Cmd):
def __init__(self):
cmd.Cmd.__init__(self)# initialize the base class
self.pathname = "e://"
self.dirname = "test"
self.prompt = "(FindFile)>"
self.intro = '''FindFilev0.1 usage:
set # set dir and path parameters
export # export result file
find keyword # set finding keyword
? # help
exit # exit current program, or use Ctrl+D(UNIX)|Ctrl+Z(Dos/Windows)
'''
def help_exit(self):
print "quits the program"
def do