  def main():     root = tkinter.Tk()     root.withdraw()  # hide the main window     try:  # handle command-line arguments         regex_string, path = sys.argv[0:]         found = re.compile(regex_string).search         file = open(path)     except Exception as e:         tkinter.messagebox.showerror('wrong command-line arguments',                                      'error: %s\n%s' % (e, __doc__),                                      parent=root)         sys.exit(__doc__)      last_line = functools.partial(filter_lastline, file, found)     label = tkinter.Label(root, text=last_line()                           or '<nothing matched %r>' % regex_string)     label.pack()      