CmdInterpreter.py 文件源码

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

项目:Jarvis 作者: sukeesh 项目源码 文件源码
def do_match(self, s):
        """Matches patterns in a string by using regex."""
        if six.PY2:
            file_name = raw_input(Fore.RED + "Enter file name?:\n" + Fore.RESET)
            pattern = raw_input(Fore.GREEN + "Enter string:\n" + Fore.RESET)
        else:
            file_name = input(Fore.RED + "Enter file name?:\n" + Fore.RESET)
            pattern = input(Fore.GREEN + "Enter string:\n" + Fore.RESET)
        file_name = file_name.strip()
        if file_name == "":
            print("Invalid Filename")
        else:
            system("grep '" + pattern + "' " + file_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号