code: def init_log_file(self):
          
          # redirect terminal output
          self.old_stdout = sys.stdout
          sys.stdout = open(os.path.join(self.WD, "demag_gui.log"), 'w+')
docs: redirects stdout to a log file to prevent printing to a hanging
          terminal when dealing with the compiled binary.