Pytml

Pytml is a 15KB lightweight PyScript alternative — run Python in HTML with one script tag.

git clone https://github.com/notamitgamer/Pytml.git
· rebuilt hourlyOpen on GitHub
root / local-file-test-local.html

local-file-test-local.html (718B)


      1 <!DOCTYPE html>
      2 <html lang="en">
      3 <head>
      4   <meta charset="UTF-8">
      5   <meta name="viewport" content="width=device-width, initial-scale=1.0">
      6   <title>Pytml file:// + local pytml.js test</title>
      7   <script src="./pytml.js"></script>
      8   <style>
      9     body { font-family: system-ui, sans-serif; padding: 24px; max-width: 720px; margin: auto; }
     10     button { padding: 10px 16px; cursor: pointer; }
     11   </style>
     12 </head>
     13 <body>
     14   <h1 id="title">Local Pytml runtime test</h1>
     15   <button id="hello">Click me</button>
     16   <p id="result">Waiting for Python…</p>
     17 
     18   <py1>
     19 
     20 def hello_clicked(event):
     21     result.text = "The local HTML file loaded the local ./pytml.js successfully."
     22 
     23 hello.on("click", hello_clicked)
     24   </py1>
     25 </body>
     26 </html>