Option 1: Inline Python (Recommended for mobile/local)
<!DOCTYPE html> <html> <head> <script src="https://pytml.vercel.app/pytml.js"></script> </head> <body> <py> print("Hello, world!") name = input("Your name? ") print(f"Hi {name}!") </py> </body> </html>
Option 2: External Python File (HTTP/HTTPS only)
<!DOCTYPE html> <html> <head> <script src="https://pytml.vercel.app/pytml.js"></script> </head> <body> <script type="text/python" src="script.py"></script> </body> </html>
name = input("Enter your name: ") age = input("Enter your age: ") print(f"Hello {name}, you are {age} years old!")
If you're running HTML locally from your device (mobile or desktop):
Use inline tags — This is the only method that works with file:// protocol
There was an error while loading. Please reload this page.