Skip to content

Usage Guide

ASWANTH R edited this page Jun 26, 2026 · 1 revision

Usage

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>
py
name = input("Enter your name: ")
age = input("Enter your age: ")
print(f"Hello {name}, you are {age} years old!")

Important for Local Users (file:// protocol)

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

Clone this wiki locally