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.html

local-file-test.html (874B)


      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:// Test</title>
      7   <!-- This page is intentionally designed to be opened directly as file:// -->
      8   <script src="https://pytml.vercel.app/pytml.js"></script>
      9   <style>
     10     body { font-family: system-ui, sans-serif; padding: 24px; max-width: 720px; margin: auto; }
     11     button { padding: 10px 16px; cursor: pointer; }
     12     #result { margin-top: 14px; }
     13   </style>
     14 </head>
     15 <body>
     16   <h1>Local file:// test</h1>
     17   <p>Open this HTML directly from your computer. No local web server is required.</p>
     18 
     19   <button id="hello">Click me</button>
     20   <p id="result">Waiting for Python…</p>
     21 
     22   <py1>
     23 
     24 def say_hello(event):
     25     result.text = "Pytml is running from a local file."
     26 
     27 hello.on("click", say_hello)
     28   </py1>
     29 </body>
     30 </html>