<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aswanth R</title>
    <description>The latest articles on DEV Community by Aswanth R (@nodex-ar).</description>
    <link>https://dev.to/nodex-ar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3977767%2F71848ca5-1320-48c0-bb06-d520b9aec1ff.jpg</url>
      <title>DEV Community: Aswanth R</title>
      <link>https://dev.to/nodex-ar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nodex-ar"/>
    <language>en</language>
    <item>
      <title>Pytml – Running Python in the Browser Without a Backend</title>
      <dc:creator>Aswanth R</dc:creator>
      <pubDate>Wed, 10 Jun 2026 13:12:13 +0000</pubDate>
      <link>https://dev.to/nodex-ar/pytml-running-python-in-the-browser-without-a-backend-1nn4</link>
      <guid>https://dev.to/nodex-ar/pytml-running-python-in-the-browser-without-a-backend-1nn4</guid>
      <description>&lt;p&gt;I wanted a lazy way to write Python and have it just work inside a webpage — no backend servers, no external APIs, just pure Python running in the browser.&lt;/p&gt;

&lt;p&gt;So I built Pytml.&lt;/p&gt;

&lt;p&gt;What is Pytml?&lt;br&gt;
Pytml is a minimal JavaScript library that lets you embed and execute Python code directly inside HTML. It wraps around Pyodide – a full Python interpreter compiled to WebAssembly – so the code runs locally in the visitor's browser.&lt;/p&gt;

&lt;p&gt;You don't need to install anything.&lt;br&gt;
You don't need a Python server.&lt;br&gt;
You just write  tags or , and Pytml does the rest.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;How It Actually Works&amp;lt;br&amp;gt;
Behind the scenes, pytml.js does four things:&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Initializes Pyodide&amp;lt;br&amp;gt;
When the page loads, the script fetches and starts Pyodide (a WebAssembly build of CPython). This takes a couple of seconds, but only once.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Redirects Python I/O&amp;lt;br&amp;gt;
Normally Python&amp;amp;#39;s print() writes to the console. Pytml overrides print() and input() so they write into a visible HTML output container inside your page. No console digging.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Scans for Python Blocks&amp;lt;br&amp;gt;
It looks for any &amp;lt;py&amp;gt; element or &amp;lt;script type="text/python"&amp;gt; and collects the Python source code inside.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Executes the Code&amp;lt;br&amp;gt;
Once Pyodide is ready, it runs the collected Python code line by line, capturing outputs and errors, and displays them nicely in the browser.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;The result? You can write real Python (including basic libraries) and have it behave like it&amp;amp;#39;s part of the webpage.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Example&amp;lt;br&amp;gt;
html&amp;lt;br&amp;gt;
&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;br&amp;gt;
&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;script src="pytml.js"&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    &lt;br&gt;
print("Hello from Python!")&lt;br&gt;
for i in range(5):&lt;br&gt;
    print(f"Counter: {i}")&lt;br&gt;
    &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
No backend. No Flask. No Django. Just HTML and Python.&lt;/p&gt;

&lt;p&gt;Real Limitations (Because Honesty Matters)&lt;br&gt;
Pyodide is heavy (≈ 6-7 MB download on first load). It's not for tiny pages.&lt;/p&gt;

&lt;p&gt;Startup latency – the first execution can take a second or two while WebAssembly boots.&lt;/p&gt;

&lt;p&gt;Limited Python libraries – Pyodide supports many pure-Python packages, but C-extensions need to be recompiled to Wasm.&lt;/p&gt;

&lt;p&gt;Why I Built It&lt;br&gt;
I'm a Class 12 student who loves Python but found it annoying to switch contexts between backend and frontend. I wanted a lazy bridge – something that lets me show my Python projects working live on a webpage without setting up a server.&lt;/p&gt;

&lt;p&gt;Pytml isn't meant to replace React or Flask. It's a learning tool, a prototyping sandbox, and maybe the start of something bigger.&lt;/p&gt;

&lt;p&gt;Links&lt;br&gt;
GitHub repo: &lt;a href="https://github.com/NodeX-AR/Pytml" rel="noopener noreferrer"&gt;https://github.com/NodeX-AR/Pytml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My portfolio: &lt;a href="https://a-r.is-a.dev" rel="noopener noreferrer"&gt;https://a-r.is-a.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>html</category>
      <category>pyodide</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
