Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you embed python scripts into the web browser?

I'm trying to see how I can get a python script to run in the web browser. Does anyone know if this is possible or would I need to make a plugin?

I'm looking for something that would work like:

<embed type="application/x-python" src="myscript.py"></embed>

Thanks, Joe

like image 466
Joe Simpson Avatar asked Dec 12 '09 20:12

Joe Simpson


People also ask

Can I run Python script in browser?

Brython is both a Python compiler and an interpreter written in JavaScript. As a result, you can compile and run Python code in the browser. A good example of this feature is demonstrated by the online editor available on the Brython website. With the online editor, Python is running in the browser.

Can you put Python code in HTML?

The new PyScript project lets you embed Python programs directly in HTML pages and execute them within the browser without any server-based requirements.

Can you run a Python script in Chrome?

Python is a programming language, you can't run native code of a programming language. You can however, run programs written in python in the browser.


1 Answers

I don't think any mainstream browser supports this by default so you'd need to write a plugin.

There are people that have tried this before though. For example, Iron Python + Silverlight.

like image 136
Mark Byers Avatar answered Sep 28 '22 05:09

Mark Byers