From 876be881cab724b9180083b71c5fe7e1d0eb72c1 Mon Sep 17 00:00:00 2001 From: dmarakom6 Date: Fri, 2 Jul 2021 10:50:21 +0300 Subject: [PATCH] testing a new feature --- util/notegrep/m.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 util/notegrep/m.py diff --git a/util/notegrep/m.py b/util/notegrep/m.py new file mode 100644 index 0000000..594bc7f --- /dev/null +++ b/util/notegrep/m.py @@ -0,0 +1,22 @@ +import sys + +class Multi(): + + def __init__(self, patterns, files): + self.patterns = patterns + self.files = files + + def print_matches(self, patterns, files): + for pattern in patterns: print(pattern, end=", ") + print() + for file in files: print(file, end=", ") + +try: + newMulti = Multi(sys.argv[1].split(','), sys.argv[2].split(',')) + newMulti.print_matches(sys.argv[1].split(','), sys.argv[2].split(',')) +except IndexError: + patterns = input("Enter patterns, separated by a comma: ") + files = input("Enter files, separated by a comma: ") + newMulti = Multi(patterns, files) + newMulti.print_matches(patterns.split(','), files.split(',')) + \ No newline at end of file