SimpleHTTPRequestHandler x files python processing

I am using the class (SimpleHTTPRequestHandler) to read directories and files (.html) that work perfectly well and are redenried naturally by the browser.

The problem is that I need to make files with extensions (.py) processed and sending the output in (html) so that the browser can render the received html.

I try to do this using the class (SimpleHTTPRequestHandler) and passing the path of the python file ( and the result I get in the browser and the pure python code? Below is the server code and the class that returns the html:

Excerpt from the class : SimpleHTTPRequestHandler

class ROOTDirectory(SimpleHTTPRequestHandler):

    def do_HEAD(self):

    def do_GET(self):

        self.path = ""
        # Trigger the do_GET method of the SimpleHTTPRequestHandler class

Class : output browser :

#! /usr/local/bin/python3.9

# Class name : Index -> Structure html page :
class Index:

    # Class method : Constructor -> Object Build :
    def __init__(self):

    # Class method : build ->  : Render code html :
    def view(self):

        # Variable : v_html5 -> Code Html
        v_html5 = """
        <!DOCTYPE html>
        <html lang="pt-BR">
            <meta charset="UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>Webstrucs Action</title>
            Python Web Server For Asynchronous Requests<br>
            Active: active (running)<br>
        return v_html5

o_html = Index()