Search code examples
pythonhtmlwebembed

Embed python in a website


I'm planning on building a website in which I execute python code stored on my computer. How can I embed python code in a website to make this possible? Is there some syntax in HTML to do this?


Solution

  • There's no way to use conventional CPython code on the client side. However, you can use Pyjs which will translate your Python code to Javascript code or Brython which is an interpreter written in Javascript. Of course, they might have some limitations.

    Hope it helps.