1st, please use code block tags around code… mark the text and hit the button above the editor that looks like </>
i will fix one, u fix the others…
now, I’m not sure that this code does…
you cannot manipulate (change) the  UI/webpage  with python in MagicMirror…
you can send info to a node_helper  spawn routine that can send info onto the module, which can manipulate (change) the UI/webpage
the module u are using has not been updated in 3 years…
https://github.com/nischi/MMM-Face-Reco-DNN, HAS been updated recently, and u might get help by posting an issue to its repo
the module u are using, launches a python script in the background and checks for responses
    pyshell.on('message', function (message) {
      
      if (message.hasOwnProperty('status')){
      console.log("[" + self.name + "] " + message.status);
      }
      if (message.hasOwnProperty('login')){
        console.log("[" + self.name + "] " + "User " + self.config.users[message.login.user - 1] + " with confidence " + message.login.confidence + " logged in.");
        self.sendSocketNotification('user', {action: "login", user: message.login.user - 1, confidence: message.login.confidence});
        }
      if (message.hasOwnProperty('logout')){
        console.log("[" + self.name + "] " + "User " + self.config.users[message.logout.user - 1] + " logged out.");
        self.sendSocketNotification('user', {action: "logout", user: message.logout.user - 1});
        }
    });
and the DNN does similar
  self.pyshell.on('message', function(message) {
      // A status message has received and will log
      if (message.hasOwnProperty('status')) {
        console.log('[' + self.name + '] ' + message.status);
      }
      // Somebody new are in front of the camera, send it back to the Magic Mirror Module
      if (message.hasOwnProperty('login')) {
only checking for login and logout