recipe-120991.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:code 作者: ActiveState 项目源码 文件源码
def callback(arg, directory, files):
    for file in files:
        if fnmatch.fnmatch(file,arg):
            for line in fileinput.input(os.path.abspath(os.path.join(directory, file)),inplace=1):
                if re.search('.*theunderdogs.*', line): # I changed * to .* but it would probably work without this if
                    line = string.replace(line,'theunderdogs','the-underdogs') # old string , new string
                print line,
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号